+Tue Jun 16 06:29:57 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckmenuitem.c (gtk_check_menu_item_set_state): check for
+ != 0 on the argument.
+
+ * gtk/gtktable.h:
+ * gtk/gtktable.c: new function gtk_table_resize() which allowes
+ shrinking and expanding of tables. implementation of widget arguments
+ and child arguments. many signedness corrections.
+
+Mon Jun 15 04:15:03 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkbox.c (gtk_box_set_child_packing): queue the resize for the box
+ not only the child, otherwise we might end up taking away other
+ childrens space after the resize.
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_menu_path): if we parse
+ an unknown menu path from any source, that path must always be flagged
+ as "modified", since we don't really know whether it has its default
+ value or not.
+
+ * gtk/gtktree.c:
+ * gtk/gtkpacker.c:
+ * gtk/gtknotebook.c:
+ * gtk/gtkmenushell.c:
+ * gtk/gtklist.c:
+ * gtk/gtkpaned.c:
+ * gtk/gtkfixed.c:
+ * gtk/gtkbutton.c: implement gtk_*_child_type functions.
+
+ * gtk/gtkbox.h:
+ * gtk/gtkbox.c: type corrections for expand, fill, padding and pack_type
+ arguments. implemented child arguments.
+
+ * more GtkType and macro fixups.
+
+Sun Jun 14 16:30:02 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckbutton.h: GtkType and macro fixups.
+
+ * gtk/gtkclist.h: exported the prototypes for gtk_clist_get_vadjustment
+ and gtk_clist_get_hadjustment.
+
+ * gtk/gtkcontainer.c:
+ implementation of children arguments, new class member functions
+ (child_type), (get_child_arg) and (set_child_arg) plus a new field
+ n_child_args.
+ (gtk_container_child_type): new function which returns the type of a
+ child that the container expects for its next addition.
+ (gtk_container_add_child_arg_type): new function to introduce a new
+ child argument at class creation time.
+ (gtk_container_query_child_args): new function to query all child
+ arguments that are supported by a container class.
+ (gtk_container_child_arg_getv): new fucntion to retrive the value of a
+ child argument.
+ (gtk_container_child_arg_setv): new function to set a child argument for
+ a certain container and child combination.
+ (gtk_container_add_with_args):
+ (gtk_container_add_with_argv): new functions to feature addition of a
+ new child in combination with the setting of certain child arguments.
+
+ * gtk/gtktypeuitils.c (gtk_type_class_init): feature initialization of
+ GtkContainerClass.n_child_args, similar to the GtkObjectClass members.
+ this should really be done through class cretion hooks some day.
+
+ * gtk/gtkcontainer.c: changed type of border_width from gint16 to
+ guint : 16.
+
+ * gtk/gtkpacker.h:
+ * gtk/gtkpacker.c: renamed all PadX and PadY to pad_x and pad_y to
+ follow the gtk convention for lower case variable names (important
+ for language wrappers and widget arguments), and made them guint : 16.
+
+ * examples/packer/pack.c: adaptions for the case converted GtkPacker
+ fields.
+
+Fri Jun 12 16:33:23 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): do not
+ change the character pair for single line comments.
+ (gtk_item_factory_parse_rc): use the cpair_comment_signle specified in
+ GtkItemFactoryClass.
+ (gtk_item_factory_parse_rc_string): likewise.
+
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
+Tue Jun 16 06:29:57 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckmenuitem.c (gtk_check_menu_item_set_state): check for
+ != 0 on the argument.
+
+ * gtk/gtktable.h:
+ * gtk/gtktable.c: new function gtk_table_resize() which allowes
+ shrinking and expanding of tables. implementation of widget arguments
+ and child arguments. many signedness corrections.
+
+Mon Jun 15 04:15:03 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkbox.c (gtk_box_set_child_packing): queue the resize for the box
+ not only the child, otherwise we might end up taking away other
+ childrens space after the resize.
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_menu_path): if we parse
+ an unknown menu path from any source, that path must always be flagged
+ as "modified", since we don't really know whether it has its default
+ value or not.
+
+ * gtk/gtktree.c:
+ * gtk/gtkpacker.c:
+ * gtk/gtknotebook.c:
+ * gtk/gtkmenushell.c:
+ * gtk/gtklist.c:
+ * gtk/gtkpaned.c:
+ * gtk/gtkfixed.c:
+ * gtk/gtkbutton.c: implement gtk_*_child_type functions.
+
+ * gtk/gtkbox.h:
+ * gtk/gtkbox.c: type corrections for expand, fill, padding and pack_type
+ arguments. implemented child arguments.
+
+ * more GtkType and macro fixups.
+
+Sun Jun 14 16:30:02 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckbutton.h: GtkType and macro fixups.
+
+ * gtk/gtkclist.h: exported the prototypes for gtk_clist_get_vadjustment
+ and gtk_clist_get_hadjustment.
+
+ * gtk/gtkcontainer.c:
+ implementation of children arguments, new class member functions
+ (child_type), (get_child_arg) and (set_child_arg) plus a new field
+ n_child_args.
+ (gtk_container_child_type): new function which returns the type of a
+ child that the container expects for its next addition.
+ (gtk_container_add_child_arg_type): new function to introduce a new
+ child argument at class creation time.
+ (gtk_container_query_child_args): new function to query all child
+ arguments that are supported by a container class.
+ (gtk_container_child_arg_getv): new fucntion to retrive the value of a
+ child argument.
+ (gtk_container_child_arg_setv): new function to set a child argument for
+ a certain container and child combination.
+ (gtk_container_add_with_args):
+ (gtk_container_add_with_argv): new functions to feature addition of a
+ new child in combination with the setting of certain child arguments.
+
+ * gtk/gtktypeuitils.c (gtk_type_class_init): feature initialization of
+ GtkContainerClass.n_child_args, similar to the GtkObjectClass members.
+ this should really be done through class cretion hooks some day.
+
+ * gtk/gtkcontainer.c: changed type of border_width from gint16 to
+ guint : 16.
+
+ * gtk/gtkpacker.h:
+ * gtk/gtkpacker.c: renamed all PadX and PadY to pad_x and pad_y to
+ follow the gtk convention for lower case variable names (important
+ for language wrappers and widget arguments), and made them guint : 16.
+
+ * examples/packer/pack.c: adaptions for the case converted GtkPacker
+ fields.
+
+Fri Jun 12 16:33:23 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): do not
+ change the character pair for single line comments.
+ (gtk_item_factory_parse_rc): use the cpair_comment_signle specified in
+ GtkItemFactoryClass.
+ (gtk_item_factory_parse_rc_string): likewise.
+
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
+Tue Jun 16 06:29:57 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckmenuitem.c (gtk_check_menu_item_set_state): check for
+ != 0 on the argument.
+
+ * gtk/gtktable.h:
+ * gtk/gtktable.c: new function gtk_table_resize() which allowes
+ shrinking and expanding of tables. implementation of widget arguments
+ and child arguments. many signedness corrections.
+
+Mon Jun 15 04:15:03 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkbox.c (gtk_box_set_child_packing): queue the resize for the box
+ not only the child, otherwise we might end up taking away other
+ childrens space after the resize.
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_menu_path): if we parse
+ an unknown menu path from any source, that path must always be flagged
+ as "modified", since we don't really know whether it has its default
+ value or not.
+
+ * gtk/gtktree.c:
+ * gtk/gtkpacker.c:
+ * gtk/gtknotebook.c:
+ * gtk/gtkmenushell.c:
+ * gtk/gtklist.c:
+ * gtk/gtkpaned.c:
+ * gtk/gtkfixed.c:
+ * gtk/gtkbutton.c: implement gtk_*_child_type functions.
+
+ * gtk/gtkbox.h:
+ * gtk/gtkbox.c: type corrections for expand, fill, padding and pack_type
+ arguments. implemented child arguments.
+
+ * more GtkType and macro fixups.
+
+Sun Jun 14 16:30:02 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckbutton.h: GtkType and macro fixups.
+
+ * gtk/gtkclist.h: exported the prototypes for gtk_clist_get_vadjustment
+ and gtk_clist_get_hadjustment.
+
+ * gtk/gtkcontainer.c:
+ implementation of children arguments, new class member functions
+ (child_type), (get_child_arg) and (set_child_arg) plus a new field
+ n_child_args.
+ (gtk_container_child_type): new function which returns the type of a
+ child that the container expects for its next addition.
+ (gtk_container_add_child_arg_type): new function to introduce a new
+ child argument at class creation time.
+ (gtk_container_query_child_args): new function to query all child
+ arguments that are supported by a container class.
+ (gtk_container_child_arg_getv): new fucntion to retrive the value of a
+ child argument.
+ (gtk_container_child_arg_setv): new function to set a child argument for
+ a certain container and child combination.
+ (gtk_container_add_with_args):
+ (gtk_container_add_with_argv): new functions to feature addition of a
+ new child in combination with the setting of certain child arguments.
+
+ * gtk/gtktypeuitils.c (gtk_type_class_init): feature initialization of
+ GtkContainerClass.n_child_args, similar to the GtkObjectClass members.
+ this should really be done through class cretion hooks some day.
+
+ * gtk/gtkcontainer.c: changed type of border_width from gint16 to
+ guint : 16.
+
+ * gtk/gtkpacker.h:
+ * gtk/gtkpacker.c: renamed all PadX and PadY to pad_x and pad_y to
+ follow the gtk convention for lower case variable names (important
+ for language wrappers and widget arguments), and made them guint : 16.
+
+ * examples/packer/pack.c: adaptions for the case converted GtkPacker
+ fields.
+
+Fri Jun 12 16:33:23 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): do not
+ change the character pair for single line comments.
+ (gtk_item_factory_parse_rc): use the cpair_comment_signle specified in
+ GtkItemFactoryClass.
+ (gtk_item_factory_parse_rc_string): likewise.
+
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
+Tue Jun 16 06:29:57 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckmenuitem.c (gtk_check_menu_item_set_state): check for
+ != 0 on the argument.
+
+ * gtk/gtktable.h:
+ * gtk/gtktable.c: new function gtk_table_resize() which allowes
+ shrinking and expanding of tables. implementation of widget arguments
+ and child arguments. many signedness corrections.
+
+Mon Jun 15 04:15:03 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkbox.c (gtk_box_set_child_packing): queue the resize for the box
+ not only the child, otherwise we might end up taking away other
+ childrens space after the resize.
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_menu_path): if we parse
+ an unknown menu path from any source, that path must always be flagged
+ as "modified", since we don't really know whether it has its default
+ value or not.
+
+ * gtk/gtktree.c:
+ * gtk/gtkpacker.c:
+ * gtk/gtknotebook.c:
+ * gtk/gtkmenushell.c:
+ * gtk/gtklist.c:
+ * gtk/gtkpaned.c:
+ * gtk/gtkfixed.c:
+ * gtk/gtkbutton.c: implement gtk_*_child_type functions.
+
+ * gtk/gtkbox.h:
+ * gtk/gtkbox.c: type corrections for expand, fill, padding and pack_type
+ arguments. implemented child arguments.
+
+ * more GtkType and macro fixups.
+
+Sun Jun 14 16:30:02 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckbutton.h: GtkType and macro fixups.
+
+ * gtk/gtkclist.h: exported the prototypes for gtk_clist_get_vadjustment
+ and gtk_clist_get_hadjustment.
+
+ * gtk/gtkcontainer.c:
+ implementation of children arguments, new class member functions
+ (child_type), (get_child_arg) and (set_child_arg) plus a new field
+ n_child_args.
+ (gtk_container_child_type): new function which returns the type of a
+ child that the container expects for its next addition.
+ (gtk_container_add_child_arg_type): new function to introduce a new
+ child argument at class creation time.
+ (gtk_container_query_child_args): new function to query all child
+ arguments that are supported by a container class.
+ (gtk_container_child_arg_getv): new fucntion to retrive the value of a
+ child argument.
+ (gtk_container_child_arg_setv): new function to set a child argument for
+ a certain container and child combination.
+ (gtk_container_add_with_args):
+ (gtk_container_add_with_argv): new functions to feature addition of a
+ new child in combination with the setting of certain child arguments.
+
+ * gtk/gtktypeuitils.c (gtk_type_class_init): feature initialization of
+ GtkContainerClass.n_child_args, similar to the GtkObjectClass members.
+ this should really be done through class cretion hooks some day.
+
+ * gtk/gtkcontainer.c: changed type of border_width from gint16 to
+ guint : 16.
+
+ * gtk/gtkpacker.h:
+ * gtk/gtkpacker.c: renamed all PadX and PadY to pad_x and pad_y to
+ follow the gtk convention for lower case variable names (important
+ for language wrappers and widget arguments), and made them guint : 16.
+
+ * examples/packer/pack.c: adaptions for the case converted GtkPacker
+ fields.
+
+Fri Jun 12 16:33:23 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): do not
+ change the character pair for single line comments.
+ (gtk_item_factory_parse_rc): use the cpair_comment_signle specified in
+ GtkItemFactoryClass.
+ (gtk_item_factory_parse_rc_string): likewise.
+
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
+Tue Jun 16 06:29:57 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckmenuitem.c (gtk_check_menu_item_set_state): check for
+ != 0 on the argument.
+
+ * gtk/gtktable.h:
+ * gtk/gtktable.c: new function gtk_table_resize() which allowes
+ shrinking and expanding of tables. implementation of widget arguments
+ and child arguments. many signedness corrections.
+
+Mon Jun 15 04:15:03 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkbox.c (gtk_box_set_child_packing): queue the resize for the box
+ not only the child, otherwise we might end up taking away other
+ childrens space after the resize.
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_menu_path): if we parse
+ an unknown menu path from any source, that path must always be flagged
+ as "modified", since we don't really know whether it has its default
+ value or not.
+
+ * gtk/gtktree.c:
+ * gtk/gtkpacker.c:
+ * gtk/gtknotebook.c:
+ * gtk/gtkmenushell.c:
+ * gtk/gtklist.c:
+ * gtk/gtkpaned.c:
+ * gtk/gtkfixed.c:
+ * gtk/gtkbutton.c: implement gtk_*_child_type functions.
+
+ * gtk/gtkbox.h:
+ * gtk/gtkbox.c: type corrections for expand, fill, padding and pack_type
+ arguments. implemented child arguments.
+
+ * more GtkType and macro fixups.
+
+Sun Jun 14 16:30:02 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckbutton.h: GtkType and macro fixups.
+
+ * gtk/gtkclist.h: exported the prototypes for gtk_clist_get_vadjustment
+ and gtk_clist_get_hadjustment.
+
+ * gtk/gtkcontainer.c:
+ implementation of children arguments, new class member functions
+ (child_type), (get_child_arg) and (set_child_arg) plus a new field
+ n_child_args.
+ (gtk_container_child_type): new function which returns the type of a
+ child that the container expects for its next addition.
+ (gtk_container_add_child_arg_type): new function to introduce a new
+ child argument at class creation time.
+ (gtk_container_query_child_args): new function to query all child
+ arguments that are supported by a container class.
+ (gtk_container_child_arg_getv): new fucntion to retrive the value of a
+ child argument.
+ (gtk_container_child_arg_setv): new function to set a child argument for
+ a certain container and child combination.
+ (gtk_container_add_with_args):
+ (gtk_container_add_with_argv): new functions to feature addition of a
+ new child in combination with the setting of certain child arguments.
+
+ * gtk/gtktypeuitils.c (gtk_type_class_init): feature initialization of
+ GtkContainerClass.n_child_args, similar to the GtkObjectClass members.
+ this should really be done through class cretion hooks some day.
+
+ * gtk/gtkcontainer.c: changed type of border_width from gint16 to
+ guint : 16.
+
+ * gtk/gtkpacker.h:
+ * gtk/gtkpacker.c: renamed all PadX and PadY to pad_x and pad_y to
+ follow the gtk convention for lower case variable names (important
+ for language wrappers and widget arguments), and made them guint : 16.
+
+ * examples/packer/pack.c: adaptions for the case converted GtkPacker
+ fields.
+
+Fri Jun 12 16:33:23 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): do not
+ change the character pair for single line comments.
+ (gtk_item_factory_parse_rc): use the cpair_comment_signle specified in
+ GtkItemFactoryClass.
+ (gtk_item_factory_parse_rc_string): likewise.
+
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
+Tue Jun 16 06:29:57 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckmenuitem.c (gtk_check_menu_item_set_state): check for
+ != 0 on the argument.
+
+ * gtk/gtktable.h:
+ * gtk/gtktable.c: new function gtk_table_resize() which allowes
+ shrinking and expanding of tables. implementation of widget arguments
+ and child arguments. many signedness corrections.
+
+Mon Jun 15 04:15:03 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkbox.c (gtk_box_set_child_packing): queue the resize for the box
+ not only the child, otherwise we might end up taking away other
+ childrens space after the resize.
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_menu_path): if we parse
+ an unknown menu path from any source, that path must always be flagged
+ as "modified", since we don't really know whether it has its default
+ value or not.
+
+ * gtk/gtktree.c:
+ * gtk/gtkpacker.c:
+ * gtk/gtknotebook.c:
+ * gtk/gtkmenushell.c:
+ * gtk/gtklist.c:
+ * gtk/gtkpaned.c:
+ * gtk/gtkfixed.c:
+ * gtk/gtkbutton.c: implement gtk_*_child_type functions.
+
+ * gtk/gtkbox.h:
+ * gtk/gtkbox.c: type corrections for expand, fill, padding and pack_type
+ arguments. implemented child arguments.
+
+ * more GtkType and macro fixups.
+
+Sun Jun 14 16:30:02 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckbutton.h: GtkType and macro fixups.
+
+ * gtk/gtkclist.h: exported the prototypes for gtk_clist_get_vadjustment
+ and gtk_clist_get_hadjustment.
+
+ * gtk/gtkcontainer.c:
+ implementation of children arguments, new class member functions
+ (child_type), (get_child_arg) and (set_child_arg) plus a new field
+ n_child_args.
+ (gtk_container_child_type): new function which returns the type of a
+ child that the container expects for its next addition.
+ (gtk_container_add_child_arg_type): new function to introduce a new
+ child argument at class creation time.
+ (gtk_container_query_child_args): new function to query all child
+ arguments that are supported by a container class.
+ (gtk_container_child_arg_getv): new fucntion to retrive the value of a
+ child argument.
+ (gtk_container_child_arg_setv): new function to set a child argument for
+ a certain container and child combination.
+ (gtk_container_add_with_args):
+ (gtk_container_add_with_argv): new functions to feature addition of a
+ new child in combination with the setting of certain child arguments.
+
+ * gtk/gtktypeuitils.c (gtk_type_class_init): feature initialization of
+ GtkContainerClass.n_child_args, similar to the GtkObjectClass members.
+ this should really be done through class cretion hooks some day.
+
+ * gtk/gtkcontainer.c: changed type of border_width from gint16 to
+ guint : 16.
+
+ * gtk/gtkpacker.h:
+ * gtk/gtkpacker.c: renamed all PadX and PadY to pad_x and pad_y to
+ follow the gtk convention for lower case variable names (important
+ for language wrappers and widget arguments), and made them guint : 16.
+
+ * examples/packer/pack.c: adaptions for the case converted GtkPacker
+ fields.
+
+Fri Jun 12 16:33:23 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): do not
+ change the character pair for single line comments.
+ (gtk_item_factory_parse_rc): use the cpair_comment_signle specified in
+ GtkItemFactoryClass.
+ (gtk_item_factory_parse_rc_string): likewise.
+
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
+Tue Jun 16 06:29:57 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckmenuitem.c (gtk_check_menu_item_set_state): check for
+ != 0 on the argument.
+
+ * gtk/gtktable.h:
+ * gtk/gtktable.c: new function gtk_table_resize() which allowes
+ shrinking and expanding of tables. implementation of widget arguments
+ and child arguments. many signedness corrections.
+
+Mon Jun 15 04:15:03 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkbox.c (gtk_box_set_child_packing): queue the resize for the box
+ not only the child, otherwise we might end up taking away other
+ childrens space after the resize.
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_menu_path): if we parse
+ an unknown menu path from any source, that path must always be flagged
+ as "modified", since we don't really know whether it has its default
+ value or not.
+
+ * gtk/gtktree.c:
+ * gtk/gtkpacker.c:
+ * gtk/gtknotebook.c:
+ * gtk/gtkmenushell.c:
+ * gtk/gtklist.c:
+ * gtk/gtkpaned.c:
+ * gtk/gtkfixed.c:
+ * gtk/gtkbutton.c: implement gtk_*_child_type functions.
+
+ * gtk/gtkbox.h:
+ * gtk/gtkbox.c: type corrections for expand, fill, padding and pack_type
+ arguments. implemented child arguments.
+
+ * more GtkType and macro fixups.
+
+Sun Jun 14 16:30:02 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcheckbutton.h: GtkType and macro fixups.
+
+ * gtk/gtkclist.h: exported the prototypes for gtk_clist_get_vadjustment
+ and gtk_clist_get_hadjustment.
+
+ * gtk/gtkcontainer.c:
+ implementation of children arguments, new class member functions
+ (child_type), (get_child_arg) and (set_child_arg) plus a new field
+ n_child_args.
+ (gtk_container_child_type): new function which returns the type of a
+ child that the container expects for its next addition.
+ (gtk_container_add_child_arg_type): new function to introduce a new
+ child argument at class creation time.
+ (gtk_container_query_child_args): new function to query all child
+ arguments that are supported by a container class.
+ (gtk_container_child_arg_getv): new fucntion to retrive the value of a
+ child argument.
+ (gtk_container_child_arg_setv): new function to set a child argument for
+ a certain container and child combination.
+ (gtk_container_add_with_args):
+ (gtk_container_add_with_argv): new functions to feature addition of a
+ new child in combination with the setting of certain child arguments.
+
+ * gtk/gtktypeuitils.c (gtk_type_class_init): feature initialization of
+ GtkContainerClass.n_child_args, similar to the GtkObjectClass members.
+ this should really be done through class cretion hooks some day.
+
+ * gtk/gtkcontainer.c: changed type of border_width from gint16 to
+ guint : 16.
+
+ * gtk/gtkpacker.h:
+ * gtk/gtkpacker.c: renamed all PadX and PadY to pad_x and pad_y to
+ follow the gtk convention for lower case variable names (important
+ for language wrappers and widget arguments), and made them guint : 16.
+
+ * examples/packer/pack.c: adaptions for the case converted GtkPacker
+ fields.
+
+Fri Jun 12 16:33:23 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): do not
+ change the character pair for single line comments.
+ (gtk_item_factory_parse_rc): use the cpair_comment_signle specified in
+ GtkItemFactoryClass.
+ (gtk_item_factory_parse_rc_string): likewise.
+
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
pchild->anchor,
fillx | filly | expand,
pchild->border_width,
- pchild->padX,
- pchild->padY,
- pchild->iPadX,
- pchild->iPadY);
+ pchild->pad_x,
+ pchild->pad_y,
+ pchild->i_pad_x,
+ pchild->i_pad_y);
}
void
anchor,
pchild->options,
pchild->border_width,
- pchild->padX,
- pchild->padY,
- pchild->iPadX,
- pchild->iPadY);
+ pchild->pad_x,
+ pchild->pad_y,
+ pchild->i_pad_x,
+ pchild->i_pad_y);
if (info->button_n != widget) {
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(info->button_n),0);
pchild->anchor,
pchild->options,
pchild->border_width,
- pchild->padX,
- pchild->padY,
- pchild->iPadX,
- pchild->iPadY);
+ pchild->pad_x,
+ pchild->pad_y,
+ pchild->i_pad_x,
+ pchild->i_pad_y);
if (info->button_top != widget) {
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(info->button_top),0);
-;; generated by makeenums.awk ; -*- scheme -*-
+;; generated by makeenums.pl ; -*- scheme -*-
-; enumerations from "../../gtk+/gtk/gtkclist.h"
+; enumerations from "./gtkclist.h"
(define-enum GtkCellType
(empty GTK_CELL_EMPTY)
(pixtext GTK_CELL_PIXTEXT)
(widget GTK_CELL_WIDGET))
-; enumerations from "../../gtk+/gtk/gtkctree.h"
+; enumerations from "./gtkctree.h"
(define-enum GtkCTreePos
(before GTK_CTREE_POS_BEFORE)
(dotted GTK_CTREE_LINES_DOTTED)
(none GTK_CTREE_LINES_NONE))
-; enumerations from "../../gtk+/gtk/gtkdebug.h"
+; enumerations from "./gtkdebug.h"
(define-flags GtkDebugFlag
(objects GTK_DEBUG_OBJECTS)
(misc GTK_DEBUG_MISC)
(signals GTK_DEBUG_SIGNALS))
-; enumerations from "../../gtk+/gtk/gtkenums.h"
+; enumerations from "./gtkenums.h"
(define-flags GtkAccelFlags
(visible GTK_ACCEL_VISIBLE)
(dialog GTK_WINDOW_DIALOG)
(popup GTK_WINDOW_POPUP))
-; enumerations from "../../gtk+/gtk/gtkfontsel.h"
+; enumerations from "./gtkfontsel.h"
(define-enum GtkFontMetricType
(ixels-metric PIXELS_METRIC)
(oints-metric POINTS_METRIC))
-; enumerations from "../../gtk+/gtk/gtkobject.h"
+; enumerations from "./gtkobject.h"
(define-flags GtkObjectFlags
(destroyed GTK_DESTROYED)
(readable GTK_ARG_READABLE)
(writable GTK_ARG_WRITABLE)
(construct GTK_ARG_CONSTRUCT)
+ (child-arg GTK_ARG_CHILD_ARG)
(mask GTK_ARG_MASK)
(readwrite GTK_ARG_READWRITE))
-; enumerations from "../../gtk+/gtk/gtkpacker.h"
+; enumerations from "./gtkpacker.h"
(define-flags GtkPackerOptions
(expand GTK_PACK_EXPAND)
(define-enum GtkAnchorType
(center GTK_ANCHOR_CENTER)
+ (north GTK_ANCHOR_NORTH)
+ (north-west GTK_ANCHOR_NORTH_WEST)
+ (north-east GTK_ANCHOR_NORTH_EAST)
+ (south GTK_ANCHOR_SOUTH)
+ (south-west GTK_ANCHOR_SOUTH_WEST)
+ (south-east GTK_ANCHOR_SOUTH_EAST)
+ (west GTK_ANCHOR_WEST)
+ (east GTK_ANCHOR_EAST)
(n GTK_ANCHOR_N)
(nw GTK_ANCHOR_NW)
(ne GTK_ANCHOR_NE)
(w GTK_ANCHOR_W)
(e GTK_ANCHOR_E))
-; enumerations from "../../gtk+/gtk/gtkprivate.h"
+; enumerations from "./gtkprivate.h"
(define-flags GtkPrivateFlags
(user-style PRIVATE_GTK_USER_STYLE)
(has-shape-mask PRIVATE_GTK_HAS_SHAPE_MASK)
(in-reparent PRIVATE_GTK_IN_REPARENT))
-; enumerations from "../../gtk+/gtk/gtkspinbutton.h"
+; enumerations from "./gtkspinbutton.h"
(define-flags GtkSpinButtonUpdatePolicy
(always GTK_UPDATE_ALWAYS)
(if-valid GTK_UPDATE_IF_VALID)
(snap-to-ticks GTK_UPDATE_SNAP_TO_TICKS))
-; enumerations from "../../gtk+/gtk/gtktoolbar.h"
+; enumerations from "./gtktoolbar.h"
(define-enum GtkToolbarChildType
(space GTK_TOOLBAR_CHILD_SPACE)
(radiobutton GTK_TOOLBAR_CHILD_RADIOBUTTON)
(widget GTK_TOOLBAR_CHILD_WIDGET))
-; enumerations from "../../gtk+/gtk/gtktree.h"
+; enumerations from "./gtktree.h"
(define-enum GtkTreeViewMode
(line GTK_TREE_VIEW_LINE)
(item GTK_TREE_VIEW_ITEM))
-; enumerations from "../../gtk+/gtk/gtktypeutils.h"
+; enumerations from "./gtktypeutils.h"
(define-enum GtkFundamentalType
(invalid GTK_TYPE_INVALID)
(c-callback GTK_TYPE_C_CALLBACK)
(object GTK_TYPE_OBJECT))
-; enumerations from "../../gtk+/gtk/gtkwidget.h"
+; enumerations from "./gtkwidget.h"
(define-flags GtkWidgetFlags
(toplevel GTK_TOPLEVEL)
(rc-style GTK_RC_STYLE)
(basic GTK_BASIC))
-; enumerations from "../../gtk+/gdk/gdkprivate.h"
+; enumerations from "../gdk/gdkprivate.h"
(define-flags GdkDebugFlag
(misc GDK_DEBUG_MISC)
(color-context GDK_DEBUG_COLOR_CONTEXT)
(xim GDK_DEBUG_XIM))
-; enumerations from "../../gtk+/gdk/gdktypes.h"
+; enumerations from "../gdk/gdktypes.h"
(define-enum GdkWindowType
(root GDK_WINDOW_ROOT)
gtk_accel_label_set_accel_widget (accel_label, (GtkWidget*) GTK_VALUE_OBJECT (*arg));
break;
default:
- arg->type = GTK_TYPE_INVALID;
break;
}
}
static void gtk_bin_foreach (GtkContainer *container,
GtkCallback callback,
gpointer callback_data);
+static GtkType gtk_bin_child_type (GtkContainer*container);
static GtkContainerClass *parent_class = NULL;
container_class->add = gtk_bin_add;
container_class->remove = gtk_bin_remove;
container_class->foreach = gtk_bin_foreach;
+ container_class->child_type = gtk_bin_child_type;
}
static void
}
+static GtkType
+gtk_bin_child_type (GtkContainer *container)
+{
+ if (!GTK_BIN (container)->child)
+ return GTK_TYPE_WIDGET;
+ else
+ return GTK_TYPE_NONE;
+}
+
static void
gtk_bin_map (GtkWidget *widget)
{
ARG_HOMOGENEOUS
};
+enum {
+ CHILD_ARG_0,
+ CHILD_ARG_EXPAND,
+ CHILD_ARG_FILL,
+ CHILD_ARG_PADDING,
+ CHILD_ARG_PACK_TYPE,
+ CHILD_ARG_POSITION
+};
+
static void gtk_box_class_init (GtkBoxClass *klass);
static void gtk_box_init (GtkBox *box);
static void gtk_box_get_arg (GtkBox *box,
static void gtk_box_foreach (GtkContainer *container,
GtkCallback callback,
gpointer callback_data);
-
+static void gtk_box_set_child_arg (GtkContainer *container,
+ GtkWidget *child,
+ GtkArg *arg,
+ guint arg_id);
+static void gtk_box_get_child_arg (GtkContainer *container,
+ GtkWidget *child,
+ GtkArg *arg,
+ guint arg_id);
+static GtkType gtk_box_child_type (GtkContainer *container);
+
static GtkContainerClass *parent_class = NULL;
gtk_object_add_arg_type ("GtkBox::spacing", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_SPACING);
gtk_object_add_arg_type ("GtkBox::homogeneous", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HOMOGENEOUS);
+ gtk_container_add_child_arg_type ("GtkBox::expand", GTK_TYPE_BOOL, GTK_ARG_READWRITE, CHILD_ARG_EXPAND);
+ gtk_container_add_child_arg_type ("GtkBox::fill", GTK_TYPE_BOOL, GTK_ARG_READWRITE, CHILD_ARG_FILL);
+ gtk_container_add_child_arg_type ("GtkBox::padding", GTK_TYPE_ULONG, GTK_ARG_READWRITE, CHILD_ARG_PADDING);
+ gtk_container_add_child_arg_type ("GtkBox::pack_type", GTK_TYPE_PACK_TYPE, GTK_ARG_READWRITE, CHILD_ARG_PACK_TYPE);
+ gtk_container_add_child_arg_type ("GtkBox::position", GTK_TYPE_LONG, GTK_ARG_READWRITE, CHILD_ARG_POSITION);
widget_class->map = gtk_box_map;
widget_class->unmap = gtk_box_unmap;
container_class->add = gtk_box_add;
container_class->remove = gtk_box_remove;
container_class->foreach = gtk_box_foreach;
+ container_class->child_type = gtk_box_child_type;
+ container_class->set_child_arg = gtk_box_set_child_arg;
+ container_class->get_child_arg = gtk_box_get_child_arg;
}
static void
gtk_box_set_homogeneous (box, GTK_VALUE_BOOL (*arg));
break;
default:
- arg->type = GTK_TYPE_INVALID;
break;
}
}
}
}
+static GtkType
+gtk_box_child_type (GtkContainer *container)
+{
+ return GTK_TYPE_WIDGET;
+}
+
+static void
+gtk_box_set_child_arg (GtkContainer *container,
+ GtkWidget *child,
+ GtkArg *arg,
+ guint arg_id)
+{
+ gboolean expand = 0;
+ gboolean fill = 0;
+ guint padding = 0;
+ GtkPackType pack_type = 0;
+
+ if (arg_id != CHILD_ARG_POSITION)
+ gtk_box_query_child_packing (GTK_BOX (container),
+ child,
+ &expand,
+ &fill,
+ &padding,
+ &pack_type);
+
+ switch (arg_id)
+ {
+ case CHILD_ARG_EXPAND:
+ gtk_box_set_child_packing (GTK_BOX (container),
+ child,
+ GTK_VALUE_BOOL (*arg),
+ fill,
+ padding,
+ pack_type);
+ break;
+ case CHILD_ARG_FILL:
+ gtk_box_set_child_packing (GTK_BOX (container),
+ child,
+ expand,
+ GTK_VALUE_BOOL (*arg),
+ padding,
+ pack_type);
+ break;
+ case CHILD_ARG_PADDING:
+ gtk_box_set_child_packing (GTK_BOX (container),
+ child,
+ expand,
+ fill,
+ GTK_VALUE_ULONG (*arg),
+ pack_type);
+ break;
+ case CHILD_ARG_PACK_TYPE:
+ gtk_box_set_child_packing (GTK_BOX (container),
+ child,
+ expand,
+ fill,
+ padding,
+ GTK_VALUE_ENUM (*arg));
+ break;
+ case CHILD_ARG_POSITION:
+ gtk_box_reorder_child (GTK_BOX (container),
+ child,
+ GTK_VALUE_LONG (*arg));
+ break;
+ default:
+ break;
+ }
+}
+
+static void
+gtk_box_get_child_arg (GtkContainer *container,
+ GtkWidget *child,
+ GtkArg *arg,
+ guint arg_id)
+{
+ gboolean expand = 0;
+ gboolean fill = 0;
+ guint padding = 0;
+ GtkPackType pack_type = 0;
+ GList *list;
+
+ if (arg_id != CHILD_ARG_POSITION)
+ gtk_box_query_child_packing (GTK_BOX (container),
+ child,
+ &expand,
+ &fill,
+ &padding,
+ &pack_type);
+
+ switch (arg_id)
+ {
+ case CHILD_ARG_EXPAND:
+ GTK_VALUE_BOOL (*arg) = expand;
+ break;
+ case CHILD_ARG_FILL:
+ GTK_VALUE_BOOL (*arg) = fill;
+ break;
+ case CHILD_ARG_PADDING:
+ GTK_VALUE_ULONG (*arg) = padding;
+ break;
+ case CHILD_ARG_PACK_TYPE:
+ GTK_VALUE_ENUM (*arg) = pack_type;
+ break;
+ case CHILD_ARG_POSITION:
+ GTK_VALUE_LONG (*arg) = 0;
+ for (list = GTK_BOX (container)->children; list; list = list->next)
+ {
+ GtkBoxChild *child_entry;
+
+ child_entry = list->data;
+ if (child_entry->widget == child)
+ break;
+ GTK_VALUE_LONG (*arg)++;
+ }
+ if (!list)
+ GTK_VALUE_LONG (*arg) = -1;
+ break;
+ default:
+ arg->type = GTK_TYPE_INVALID;
+ break;
+ }
+}
+
void
gtk_box_pack_start (GtkBox *box,
GtkWidget *child,
- gint expand,
- gint fill,
- gint padding)
+ gboolean expand,
+ gboolean fill,
+ guint padding)
{
GtkBoxChild *child_info;
void
gtk_box_pack_end (GtkBox *box,
GtkWidget *child,
- gint expand,
- gint fill,
- gint padding)
+ gboolean expand,
+ gboolean fill,
+ guint padding)
{
GtkBoxChild *child_info;
}
void
-gtk_box_set_homogeneous (GtkBox *box,
- gint homogeneous)
+gtk_box_set_homogeneous (GtkBox *box,
+ gboolean homogeneous)
{
g_return_if_fail (box != NULL);
g_return_if_fail (GTK_IS_BOX (box));
void
gtk_box_reorder_child (GtkBox *box,
GtkWidget *child,
- guint pos)
+ gint position)
{
GList *list;
box->children = list->next;
tmp_list = box->children;
- while (pos && tmp_list->next)
+ while (position && tmp_list->next)
{
- pos--;
+ position--;
tmp_list = tmp_list->next;
}
- if (pos)
+ if (position)
{
tmp_list->next = list;
list->prev = tmp_list;
void
gtk_box_query_child_packing (GtkBox *box,
GtkWidget *child,
- gint *expand,
- gint *fill,
- gint *padding,
+ gboolean *expand,
+ gboolean *fill,
+ guint *padding,
GtkPackType *pack_type)
{
GList *list;
void
gtk_box_set_child_packing (GtkBox *box,
GtkWidget *child,
- gint expand,
- gint fill,
- gint padding,
- GtkPackType pack_type)
+ gboolean expand,
+ gboolean fill,
+ guint padding,
+ GtkPackType pack_type)
{
GList *list;
GtkBoxChild *child_info;
child_info->pack = GTK_PACK_START;
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
- gtk_widget_queue_resize (child);
+ gtk_widget_queue_resize (GTK_WIDGET (box));
}
}
guint gtk_box_get_type (void);
void gtk_box_pack_start (GtkBox *box,
GtkWidget *child,
- gint expand,
- gint fill,
- gint padding);
+ gboolean expand,
+ gboolean fill,
+ guint padding);
void gtk_box_pack_end (GtkBox *box,
GtkWidget *child,
- gint expand,
- gint fill,
- gint padding);
+ gboolean expand,
+ gboolean fill,
+ guint padding);
void gtk_box_pack_start_defaults (GtkBox *box,
GtkWidget *widget);
void gtk_box_pack_end_defaults (GtkBox *box,
GtkWidget *widget);
void gtk_box_set_homogeneous (GtkBox *box,
- gint homogeneous);
+ gboolean homogeneous);
void gtk_box_set_spacing (GtkBox *box,
gint spacing);
void gtk_box_reorder_child (GtkBox *box,
GtkWidget *child,
- guint pos);
+ gint position);
void gtk_box_query_child_packing (GtkBox *box,
GtkWidget *child,
- gint *expand,
- gint *fill,
- gint *padding,
+ gboolean *expand,
+ gboolean *fill,
+ guint *padding,
GtkPackType *pack_type);
void gtk_box_set_child_packing (GtkBox *box,
GtkWidget *child,
- gint expand,
- gint fill,
- gint padding,
+ gboolean expand,
+ gboolean fill,
+ guint padding,
GtkPackType pack_type);
static void gtk_button_set_arg (GtkButton *button,
GtkArg *arg,
guint arg_id);
+static void gtk_button_get_arg (GtkButton *button,
+ GtkArg *arg,
+ guint arg_id);
static void gtk_button_map (GtkWidget *widget);
static void gtk_button_unmap (GtkWidget *widget);
static void gtk_button_realize (GtkWidget *widget);
static void gtk_real_button_released (GtkButton *button);
static void gtk_real_button_enter (GtkButton *button);
static void gtk_real_button_leave (GtkButton *button);
+static GtkType gtk_button_child_type (GtkContainer *container);
static GtkContainerClass *parent_class;
(GtkClassInitFunc) gtk_button_class_init,
(GtkObjectInitFunc) gtk_button_init,
(GtkArgSetFunc) gtk_button_set_arg,
- (GtkArgGetFunc) NULL,
+ (GtkArgGetFunc) gtk_button_get_arg,
};
button_type = gtk_type_unique (gtk_container_get_type (), &button_info);
parent_class = gtk_type_class (gtk_container_get_type ());
- gtk_object_add_arg_type ("GtkButton::label", GTK_TYPE_STRING, GTK_ARG_WRITABLE, ARG_LABEL);
+ gtk_object_add_arg_type ("GtkButton::label", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_LABEL);
button_signals[PRESSED] =
gtk_signal_new ("pressed",
container_class->add = gtk_button_add;
container_class->remove = gtk_button_remove;
container_class->foreach = gtk_button_foreach;
+ container_class->child_type = gtk_button_child_type;
klass->pressed = gtk_real_button_pressed;
klass->released = gtk_real_button_released;
button->relief = GTK_RELIEF_NORMAL;
}
+static GtkType
+gtk_button_child_type (GtkContainer *container)
+{
+ if (!GTK_BUTTON (container)->child)
+ return GTK_TYPE_WIDGET;
+ else
+ return GTK_TYPE_NONE;
+}
+
static void
gtk_button_set_arg (GtkButton *button,
GtkArg *arg,
button->child = NULL;
}
- label = gtk_label_new (GTK_VALUE_STRING(*arg));
+ label = gtk_label_new (GTK_VALUE_STRING(*arg) ? GTK_VALUE_STRING(*arg) : "");
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (button), label);
gtk_container_enable_resize (GTK_CONTAINER (button));
break;
+ default:
+ break;
+ }
+}
+
+static void
+gtk_button_get_arg (GtkButton *button,
+ GtkArg *arg,
+ guint arg_id)
+{
+ switch (arg_id)
+ {
+ case ARG_LABEL:
+ if (button->child && GTK_IS_LABEL (button->child))
+ GTK_VALUE_STRING (*arg) = g_strdup (GTK_LABEL (button->child)->label);
+ else
+ GTK_VALUE_STRING (*arg) = NULL;
+ break;
default:
arg->type = GTK_TYPE_INVALID;
break;
static GtkToggleButtonClass *parent_class = NULL;
-guint
+GtkType
gtk_check_button_get_type (void)
{
- static guint check_button_type = 0;
+ static GtkType check_button_type = 0;
if (!check_button_type)
{
#endif /* __cplusplus */
-#define GTK_CHECK_BUTTON(obj) GTK_CHECK_CAST (obj, gtk_check_button_get_type (), GtkCheckButton)
-#define GTK_CHECK_BUTTON_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_check_button_get_type (), GtkCheckButtonClass)
-#define GTK_IS_CHECK_BUTTON(obj) GTK_CHECK_TYPE (obj, gtk_check_button_get_type ())
+#define GTK_TYPE_CHECK_BUTTON (gtk_check_button_get_type ())
+#define GTK_CHECK_BUTTON(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CHECK_BUTTON, GtkCheckButton))
+#define GTK_CHECK_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CHECK_BUTTON, GtkCheckButtonClass))
+#define GTK_IS_CHECK_BUTTON(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CHECK_BUTTON))
+#define GTK_IS_CHECK_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CHECK_BUTTON))
typedef struct _GtkCheckButton GtkCheckButton;
};
-guint gtk_check_button_get_type (void);
+GtkType gtk_check_button_get_type (void);
GtkWidget* gtk_check_button_new (void);
GtkWidget* gtk_check_button_new_with_label (const gchar *label);
g_return_if_fail (check_menu_item != NULL);
g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (check_menu_item));
- if (check_menu_item->active != state)
+ if (check_menu_item->active != (state != 0))
gtk_menu_item_activate (GTK_MENU_ITEM (check_menu_item));
}
return GTK_VISIBILITY_FULL;
}
-GtkAdjustment *
+GtkAdjustment*
gtk_clist_get_vadjustment (GtkCList * clist)
{
g_return_val_if_fail (clist != NULL, NULL);
return gtk_range_get_adjustment (GTK_RANGE (clist->vscrollbar));
}
-GtkAdjustment *
+GtkAdjustment*
gtk_clist_get_hadjustment (GtkCList * clist)
{
g_return_val_if_fail (clist != NULL, NULL);
GTK_CELL_WIDGET
} GtkCellType;
-#define GTK_CLIST(obj) (GTK_CHECK_CAST ((obj), gtk_clist_get_type (), GtkCList))
-#define GTK_CLIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), gtk_clist_get_type (), GtkCListClass))
-#define GTK_IS_CLIST(obj) (GTK_CHECK_TYPE ((obj), gtk_clist_get_type ()))
+#define GTK_TYPE_CLIST (gtk_clist_get_type ())
+#define GTK_CLIST(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CLIST, GtkCList))
+#define GTK_CLIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CLIST, GtkCListClass))
+#define GTK_IS_CLIST(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CLIST))
+#define GTK_IS_CLIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CLIST))
#define GTK_CLIST_FLAGS(clist) (GTK_CLIST (clist)->flags)
#define GTK_CLIST_SET_FLAG(clist,flag) (GTK_CLIST_FLAGS (clist) |= (GTK_ ## flag))
GtkVisibility gtk_clist_row_is_visible (GtkCList * clist,
gint row);
+GtkAdjustment* gtk_clist_get_vadjustment (GtkCList * clist);
+GtkAdjustment* gtk_clist_get_hadjustment (GtkCList * clist);
+
/* returns the cell type */
GtkCellType gtk_clist_get_cell_type (GtkCList * clist,
gint row,
#include "gtkcontainer.h"
#include "gtkprivate.h"
#include "gtksignal.h"
+#include <stdarg.h>
enum {
ARG_CHILD
};
+typedef struct _GtkLArgInfo GtkLArgInfo;
+struct _GtkLArgInfo
+{
+ gchar *name;
+ GtkType type;
+ GtkType class_type;
+ guint arg_flags;
+ guint arg_id;
+ guint seq_id;
+};
+
typedef void (*GtkContainerSignal1) (GtkObject *object,
gpointer arg1,
static void gtk_container_show_all (GtkWidget *widget);
static void gtk_container_hide_all (GtkWidget *widget);
+GtkArg* gtk_object_collect_args (guint *n_args,
+ va_list args1,
+ va_list args2);
+
static guint container_signals[LAST_SIGNAL] = { 0 };
+static GHashTable *arg_info_ht = NULL;
static GtkWidgetClass *parent_class = NULL;
vadjustment_key_id = gtk_object_data_force_id (vadjustment_key);
hadjustment_key_id = gtk_object_data_force_id (hadjustment_key);
- gtk_object_add_arg_type ("GtkContainer::border_width", GTK_TYPE_LONG, GTK_ARG_READWRITE, ARG_BORDER_WIDTH);
+ gtk_object_add_arg_type ("GtkContainer::border_width", GTK_TYPE_ULONG, GTK_ARG_READWRITE, ARG_BORDER_WIDTH);
gtk_object_add_arg_type ("GtkContainer::auto_resize", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_AUTO_RESIZE);
gtk_object_add_arg_type ("GtkContainer::block_resize", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_BLOCK_RESIZE);
gtk_object_add_arg_type ("GtkContainer::child", GTK_TYPE_WIDGET, GTK_ARG_WRITABLE, ARG_CHILD);
class->foreach = NULL;
class->focus = gtk_container_real_focus;
class->set_focus_child = gtk_container_real_set_focus_child;
+
+ /* linkage */
+ class->child_type = NULL;
+ class->get_child_arg = NULL;
+ class->set_child_arg = NULL;
+}
+
+static void
+gtk_container_get_child_arg (GtkContainer *container,
+ GtkWidget *child,
+ GtkType type,
+ GtkArg *arg,
+ guint arg_id)
+{
+ GtkContainerClass *class;
+
+ g_return_if_fail (container != NULL);
+ g_return_if_fail (GTK_IS_CONTAINER (container));
+ g_return_if_fail (child != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ class = GTK_CONTAINER_CLASS (GTK_OBJECT (container)->klass);
+
+ if (class->get_child_arg)
+ class->get_child_arg (container, child, arg, arg_id);
+ else
+ arg->type = GTK_TYPE_INVALID;
+}
+
+static void
+gtk_container_set_child_arg (GtkContainer *container,
+ GtkWidget *child,
+ GtkType type,
+ GtkArg *arg,
+ guint arg_id)
+{
+ GtkContainerClass *class;
+
+ g_return_if_fail (container != NULL);
+ g_return_if_fail (GTK_IS_CONTAINER (container));
+ g_return_if_fail (child != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ class = GTK_CONTAINER_CLASS (GTK_OBJECT (container)->klass);
+
+ if (class->set_child_arg)
+ class->set_child_arg (container, child, arg, arg_id);
+}
+
+GtkType
+gtk_container_child_type (GtkContainer *container)
+{
+ GtkType slot;
+ GtkContainerClass *class;
+
+ g_return_val_if_fail (container != NULL, 0);
+ g_return_val_if_fail (GTK_IS_CONTAINER (container), 0);
+
+ slot = GTK_TYPE_NONE;
+ class = GTK_CONTAINER_CLASS (GTK_OBJECT (container)->klass);
+ if (class->child_type)
+ slot = class->child_type (container);
+
+ return slot;
+}
+
+void
+gtk_container_add_child_arg_type (const gchar *arg_name,
+ GtkType arg_type,
+ guint arg_flags,
+ guint arg_id)
+{
+ GtkLArgInfo *info;
+ gchar class_part[1024];
+ gchar *arg_part;
+ GtkType class_type;
+
+ g_return_if_fail (arg_name != NULL);
+ g_return_if_fail (arg_type > GTK_TYPE_NONE);
+ g_return_if_fail (arg_id > 0);
+ g_return_if_fail ((arg_flags & GTK_ARG_READWRITE) == GTK_ARG_READWRITE);
+
+ arg_flags |= GTK_ARG_CHILD_ARG;
+ arg_flags &= GTK_ARG_MASK;
+
+ arg_part = strchr (arg_name, ':');
+ if (!arg_part || (arg_part[0] != ':') || (arg_part[1] != ':'))
+ {
+ g_warning ("gtk_container_add_arg_type(): invalid arg name: \"%s\"\n", arg_name);
+ return;
+ }
+
+ strncpy (class_part, arg_name, (glong) (arg_part - arg_name));
+ class_part[(glong) (arg_part - arg_name)] = '\0';
+
+ class_type = gtk_type_from_name (class_part);
+ if (!class_type && !gtk_type_is_a (class_type, GTK_TYPE_CONTAINER))
+ {
+ g_warning ("gtk_container_add_arg_type(): invalid class name in arg: \"%s\"\n", arg_name);
+ return;
+ }
+
+ info = g_new (GtkLArgInfo, 1);
+ info->name = g_strdup (arg_name);
+ info->type = arg_type;
+ info->class_type = class_type;
+ info->arg_flags = arg_flags;
+ info->arg_id = arg_id;
+ info->seq_id = ++((GtkContainerClass*) gtk_type_class (class_type))->n_child_args;
+
+ if (!arg_info_ht)
+ arg_info_ht = g_hash_table_new (g_str_hash, g_str_equal);
+
+ g_hash_table_insert (arg_info_ht, info->name, info);
+}
+
+typedef struct
+{
+ GList *arg_list;
+ GtkType class_type;
+} GtkQueryLArgData;
+
+static void
+gtk_query_larg_foreach (gpointer key,
+ gpointer value,
+ gpointer user_data)
+{
+ register GtkLArgInfo *info;
+ register GtkQueryLArgData *data;
+
+ info = value;
+ data = user_data;
+
+ if (info->class_type == data->class_type)
+ data->arg_list = g_list_prepend (data->arg_list, info);
+}
+
+GtkArg*
+gtk_container_query_child_args (GtkType class_type,
+ guint32 **arg_flags,
+ guint *n_args)
+{
+ GtkArg *args;
+ GtkQueryLArgData query_data;
+
+ if (arg_flags)
+ *arg_flags = NULL;
+ g_return_val_if_fail (n_args != NULL, NULL);
+ *n_args = 0;
+ g_return_val_if_fail (gtk_type_is_a (class_type, GTK_TYPE_CONTAINER), NULL);
+
+ if (!arg_info_ht)
+ return NULL;
+
+ /* make sure the types class has been initialized, because
+ * the argument setup happens in the gtk_*_class_init() functions.
+ */
+ gtk_type_class (class_type);
+
+ query_data.arg_list = NULL;
+ query_data.class_type = class_type;
+ g_hash_table_foreach (arg_info_ht, gtk_query_larg_foreach, &query_data);
+
+ if (query_data.arg_list)
+ {
+ register GList *list;
+ register guint len;
+
+ list = query_data.arg_list;
+ len = 1;
+ while (list->next)
+ {
+ len++;
+ list = list->next;
+ }
+ g_assert (len == ((GtkContainerClass*) gtk_type_class (class_type))->n_child_args); /* paranoid */
+
+ args = g_new0 (GtkArg, len);
+ *n_args = len;
+ if (arg_flags)
+ *arg_flags = g_new (guint32, len);
+
+ do
+ {
+ GtkLArgInfo *info;
+
+ info = list->data;
+ list = list->prev;
+
+ g_assert (info->seq_id > 0 && info->seq_id <= len); /* paranoid */
+
+ args[info->seq_id - 1].type = info->type;
+ args[info->seq_id - 1].name = info->name;
+ if (arg_flags)
+ (*arg_flags)[info->seq_id - 1] = info->arg_flags;
+ }
+ while (list);
+
+ g_list_free (query_data.arg_list);
+ }
+ else
+ args = NULL;
+
+ return args;
+}
+
+void
+gtk_container_child_arg_getv (GtkContainer *container,
+ GtkWidget *child,
+ guint n_args,
+ GtkArg *args)
+{
+ guint i;
+
+ g_return_if_fail (container != NULL);
+ g_return_if_fail (GTK_IS_CONTAINER (container));
+ g_return_if_fail (child != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ if (!arg_info_ht)
+ return;
+
+ for (i = 0; i < n_args; i++)
+ {
+ GtkLArgInfo *info;
+ gchar *lookup_name;
+ gchar *d;
+
+
+ /* hm, the name cutting shouldn't be needed on gets, but what the heck...
+ */
+ lookup_name = g_strdup (args[i].name);
+ d = strchr (lookup_name, ':');
+ if (d && d[1] == ':')
+ {
+ d = strchr (d + 2, ':');
+ if (d)
+ *d = 0;
+
+ info = g_hash_table_lookup (arg_info_ht, lookup_name);
+ }
+ else
+ info = NULL;
+
+ if (!info)
+ {
+ g_warning ("gtk_container_child_arg_getv(): invalid arg name: \"%s\"\n",
+ lookup_name);
+ args[i].type = GTK_TYPE_INVALID;
+ g_free (lookup_name);
+ continue;
+ }
+ else if (!gtk_type_is_a (GTK_OBJECT_TYPE (container), info->class_type))
+ {
+ g_warning ("gtk_container_child_arg_getv(): invalid arg for %s: \"%s\"\n",
+ gtk_type_name (GTK_OBJECT_TYPE (container)), lookup_name);
+ args[i].type = GTK_TYPE_INVALID;
+ g_free (lookup_name);
+ continue;
+ }
+ else if (! (info->arg_flags & GTK_ARG_READABLE))
+ {
+ g_warning ("gtk_container_child_arg_getv(): arg is not supplied for read-access: \"%s\"\n",
+ lookup_name);
+ args[i].type = GTK_TYPE_INVALID;
+ g_free (lookup_name);
+ continue;
+ }
+ else
+ g_free (lookup_name);
+
+ args[i].type = info->type;
+ gtk_container_get_child_arg (container, child, info->class_type, &args[i], info->arg_id);
+ }
+}
+
+void
+gtk_container_child_arg_setv (GtkContainer *container,
+ GtkWidget *child,
+ guint n_args,
+ GtkArg *args)
+{
+ guint i;
+
+ g_return_if_fail (container != NULL);
+ g_return_if_fail (GTK_IS_CONTAINER (container));
+ g_return_if_fail (child != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ if (!arg_info_ht)
+ return;
+
+ for (i = 0; i < n_args; i++)
+ {
+ GtkLArgInfo *info;
+ gchar *lookup_name;
+ gchar *d;
+ gboolean arg_ok;
+
+ lookup_name = g_strdup (args[i].name);
+ d = strchr (lookup_name, ':');
+ if (d && d[1] == ':')
+ {
+ d = strchr (d + 2, ':');
+ if (d)
+ *d = 0;
+
+ info = g_hash_table_lookup (arg_info_ht, lookup_name);
+ }
+ else
+ info = NULL;
+
+ arg_ok = TRUE;
+
+ if (!info)
+ {
+ g_warning ("gtk_container_child_arg_setv(): invalid arg name: \"%s\"\n",
+ lookup_name);
+ arg_ok = FALSE;
+ }
+ else if (info->type != args[i].type)
+ {
+ g_warning ("gtk_container_child_arg_setv(): invalid arg type for: \"%s\"\n",
+ lookup_name);
+ arg_ok = FALSE;
+ }
+ else if (!gtk_type_is_a (GTK_OBJECT_TYPE (container), info->class_type))
+ {
+ g_warning ("gtk_container_child_arg_setv(): invalid arg for %s: \"%s\"\n",
+ gtk_type_name (GTK_OBJECT_TYPE (container)), lookup_name);
+ arg_ok = FALSE;
+ }
+ else if (! (info->arg_flags & GTK_ARG_WRITABLE))
+ {
+ g_warning ("gtk_container_child_arg_setv(): arg is not supplied for write-access: \"%s\"\n",
+ lookup_name);
+ arg_ok = FALSE;
+ }
+
+ g_free (lookup_name);
+
+ if (!arg_ok)
+ continue;
+
+ gtk_container_set_child_arg (container, child, info->class_type, &args[i], info->arg_id);
+ }
+}
+
+void
+gtk_container_add_with_args (GtkContainer *container,
+ GtkWidget *widget,
+ ...)
+{
+ g_return_if_fail (container != NULL);
+ g_return_if_fail (GTK_IS_CONTAINER (container));
+ g_return_if_fail (widget != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (widget->parent == NULL);
+
+ gtk_widget_ref (GTK_WIDGET (container));
+ gtk_widget_ref (widget);
+
+ gtk_signal_emit (GTK_OBJECT (container), container_signals[ADD], widget);
+
+ if (widget->parent)
+ {
+ GtkArg *args;
+ guint n_args;
+ va_list args1;
+ va_list args2;
+
+ va_start (args1, widget);
+ va_start (args2, widget);
+
+ args = gtk_object_collect_args (&n_args, args1, args2);
+ gtk_container_child_arg_setv (container, widget, n_args, args);
+ g_free (args);
+
+ va_end (args1);
+ va_end (args2);
+ }
+
+ gtk_widget_unref (widget);
+ gtk_widget_unref (GTK_WIDGET (container));
+}
+
+void
+gtk_container_add_with_argv (GtkContainer *container,
+ GtkWidget *widget,
+ guint n_args,
+ GtkArg *args)
+{
+ g_return_if_fail (container != NULL);
+ g_return_if_fail (GTK_IS_CONTAINER (container));
+ g_return_if_fail (widget != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (widget->parent == NULL);
+
+ gtk_widget_ref (GTK_WIDGET (container));
+ gtk_widget_ref (widget);
+
+ gtk_signal_emit (GTK_OBJECT (container), container_signals[ADD], widget);
+
+ if (widget->parent)
+ gtk_container_child_arg_setv (container, widget, n_args, args);
+
+ gtk_widget_unref (widget);
+ gtk_widget_unref (GTK_WIDGET (container));
}
static void
switch (arg_id)
{
case ARG_BORDER_WIDTH:
- gtk_container_border_width (container, GTK_VALUE_LONG (*arg));
+ gtk_container_border_width (container, GTK_VALUE_ULONG (*arg));
break;
case ARG_AUTO_RESIZE:
if (GTK_VALUE_BOOL (*arg))
gtk_container_add (container, GTK_WIDGET (GTK_VALUE_OBJECT (*arg)));
break;
default:
- arg->type = GTK_TYPE_INVALID;
break;
}
}
switch (arg_id)
{
case ARG_BORDER_WIDTH:
- GTK_VALUE_LONG (*arg) = container->border_width;
+ GTK_VALUE_ULONG (*arg) = container->border_width;
break;
case ARG_AUTO_RESIZE:
GTK_VALUE_BOOL (*arg) = container->auto_resize;
void
gtk_container_border_width (GtkContainer *container,
- gint border_width)
+ guint border_width)
{
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_CONTAINER (container));
GtkWidget *focus_child;
- gint16 border_width;
+ guint border_width : 16;
guint auto_resize : 1;
guint need_resize : 1;
guint block_resize : 1;
{
GtkWidgetClass parent_class;
+ guint n_child_args;
+
void (* add) (GtkContainer *container,
GtkWidget *widget);
void (* remove) (GtkContainer *container,
GtkDirectionType direction);
void (* set_focus_child) (GtkContainer *container,
GtkWidget *widget);
+ GtkType (*child_type) (GtkContainer *container);
+ void (*set_child_arg) (GtkContainer *container,
+ GtkWidget *child,
+ GtkArg *arg,
+ guint arg_id);
+ void (*get_child_arg) (GtkContainer *container,
+ GtkWidget *child,
+ GtkArg *arg,
+ guint arg_id);
};
-
GtkType gtk_container_get_type (void);
void gtk_container_border_width (GtkContainer *container,
- gint border_width);
+ guint border_width);
void gtk_container_add (GtkContainer *container,
GtkWidget *widget);
void gtk_container_remove (GtkContainer *container,
GtkAdjustment *adjustment);
void gtk_container_set_focus_hadjustment (GtkContainer *container,
GtkAdjustment *adjustment);
-
+
+GtkType gtk_container_child_type (GtkContainer *container);
+
+void gtk_container_add_child_arg_type (const gchar *arg_name,
+ GtkType arg_type,
+ guint arg_flags,
+ guint arg_id);
+
+/* Allocate a GtkArg array of size nargs that hold the
+ * names and types of the args that can be used with
+ * gtk_container_child_arg_get/gtk_container_child_arg_set.
+ * if (arg_flags!=NULL),
+ * (*arg_flags) will be set to point to a newly allocated
+ * guint array that holds the flags of the args.
+ * It is the callers response to do a
+ * g_free (returned_args); g_free (*arg_flags).
+ */
+GtkArg* gtk_container_query_child_args (GtkType class_type,
+ guint32 **arg_flags,
+ guint *nargs);
+
+/* gtk_container_child_arg_getv() sets an arguments type and value, or just
+ * its type to GTK_TYPE_INVALID.
+ * if arg->type == GTK_TYPE_STRING, it's the callers response to
+ * do a g_free (GTK_VALUE_STRING (arg));
+ */
+void gtk_container_child_arg_getv (GtkContainer *container,
+ GtkWidget *child,
+ guint n_args,
+ GtkArg *args);
+void gtk_container_child_arg_setv (GtkContainer *container,
+ GtkWidget *child,
+ guint n_args,
+ GtkArg *args);
+
+/* gtk_container_add_with_args() takes a variable argument list of the form:
+ * (..., gchar *arg_name, ARG_VALUES, [repeatedly name/value pairs,] NULL)
+ * where ARG_VALUES type depend on the argument and can consist of
+ * more than one c-function argument.
+ */
+void gtk_container_add_with_args (GtkContainer *container,
+ GtkWidget *widget,
+ ...);
+void gtk_container_add_with_argv (GtkContainer *container,
+ GtkWidget *widget,
+ guint n_args,
+ GtkArg *args);
static void gtk_fixed_foreach (GtkContainer *container,
GtkCallback callback,
gpointer callback_data);
+static GtkType gtk_fixed_child_type (GtkContainer *container);
static GtkContainerClass *parent_class = NULL;
container_class->add = gtk_fixed_add;
container_class->remove = gtk_fixed_remove;
container_class->foreach = gtk_fixed_foreach;
+ container_class->child_type = gtk_fixed_child_type;
+}
+
+static GtkType
+gtk_fixed_child_type (GtkContainer *container)
+{
+ return GTK_TYPE_WIDGET;
}
static void
gtk_frame_set_shadow_type (frame, GTK_VALUE_ENUM (*arg));
break;
default:
- arg->type = GTK_TYPE_INVALID;
break;
}
}
(GtkArgGetFunc) NULL,
};
- item_factory_type = gtk_type_unique (gtk_object_get_type (), &item_factory_info);
+ item_factory_type = gtk_type_unique (GTK_TYPE_OBJECT, &item_factory_info);
}
return item_factory_type;
gtk_item_factory_class = class;
- parent_class = gtk_type_class (gtk_object_get_type ());
+ parent_class = gtk_type_class (GTK_TYPE_OBJECT);
object_class = (GtkObjectClass*) class;
g_return_if_fail (GTK_IS_ITEM_FACTORY (ifactory));
g_return_if_fail (ifactory->accel_group == NULL);
g_return_if_fail (path != NULL);
- if (!gtk_type_is_a (container_type, gtk_option_menu_get_type ()))
- g_return_if_fail (gtk_type_is_a (container_type, gtk_menu_shell_get_type ()));
+ if (!gtk_type_is_a (container_type, GTK_TYPE_OPTION_MENU))
+ g_return_if_fail (gtk_type_is_a (container_type, GTK_TYPE_MENU_SHELL));
len = strlen (path);
radio_group = NULL;
if (type_id == key_id_type_item)
- type = gtk_menu_item_get_type ();
+ type = GTK_TYPE_MENU_ITEM;
else if (type_id == key_id_type_title)
- type = gtk_menu_item_get_type ();
+ type = GTK_TYPE_MENU_ITEM;
else if (type_id == key_id_type_radio_item)
- type = gtk_radio_menu_item_get_type ();
+ type = GTK_TYPE_RADIO_MENU_ITEM;
else if (type_id == key_id_type_check_item)
- type = gtk_check_menu_item_get_type ();
+ type = GTK_TYPE_CHECK_MENU_ITEM;
else if (type_id == key_id_type_toggle_item)
- type = gtk_check_menu_item_get_type ();
+ type = GTK_TYPE_CHECK_MENU_ITEM;
else if (type_id == key_id_type_separator_item)
- type = gtk_menu_item_get_type ();
+ type = GTK_TYPE_MENU_ITEM;
else if (type_id == key_id_type_branch)
- type = gtk_menu_item_get_type ();
+ type = GTK_TYPE_MENU_ITEM;
else if (type_id == key_id_type_last_branch)
- type = gtk_menu_item_get_type ();
+ type = GTK_TYPE_MENU_ITEM;
else
{
GtkWidget *radio_link;
radio_link = gtk_item_factory_get_widget (ifactory, item_type_path);
if (radio_link && GTK_IS_RADIO_MENU_ITEM (radio_link))
{
- type = gtk_radio_menu_item_get_type ();
+ type = GTK_TYPE_RADIO_MENU_ITEM;
radio_group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (radio_link));
}
else
"GtkWidget::parent", parent,
NULL);
- if (type == gtk_radio_menu_item_get_type ())
+ if (type == GTK_TYPE_RADIO_MENU_ITEM)
gtk_radio_menu_item_set_group (GTK_RADIO_MENU_ITEM (widget), radio_group);
if (GTK_IS_CHECK_MENU_ITEM (widget))
gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (widget), TRUE);
parent = widget;
widget =
- gtk_widget_new (gtk_menu_get_type (),
+ gtk_widget_new (GTK_TYPE_MENU,
NULL);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (parent), widget);
}
item->path = g_strdup (scanner->value.v_string);
item->accelerator_key = 0;
item->accelerator_mods = 0;
- item->modified = FALSE;
+ item->modified = TRUE;
item->in_propagation = FALSE;
item->item_type = NULL;
item->widgets = NULL;
g_return_if_fail (rc_string != NULL);
+ ifactory_scanner_config.cpair_comment_single = gtk_item_factory_class->cpair_comment_single;
scanner = g_scanner_new (&ifactory_scanner_config);
g_scanner_input_text (scanner, rc_string, strlen (rc_string));
void
gtk_item_factory_parse_rc_scanner (GScanner *scanner)
{
- gchar *orig_cpair_comment_single;
gpointer saved_symbol;
g_return_if_fail (scanner != NULL);
g_scanner_remove_symbol (scanner, "menu-path");
g_scanner_add_symbol (scanner, "menu-path", gtk_item_factory_parse_menu_path);
- orig_cpair_comment_single = scanner->config->cpair_comment_single;
- scanner->config->cpair_comment_single = gtk_item_factory_class->cpair_comment_single;
-
g_scanner_peek_next_token (scanner);
while (scanner->next_token == '(')
g_scanner_peek_next_token (scanner);
}
- scanner->config->cpair_comment_single = orig_cpair_comment_single;
-
g_scanner_remove_symbol (scanner, "menu-path");
g_scanner_add_symbol (scanner, "menu-path", saved_symbol);
}
if (fd < 0)
return;
+ ifactory_scanner_config.cpair_comment_single = gtk_item_factory_class->cpair_comment_single;
scanner = g_scanner_new (&ifactory_scanner_config);
g_scanner_input_file (scanner, fd);
GtkType gtk_item_factory_get_type (void);
-/* `container_type' must be of gtk_menu_bar_get_type (), gtk_menu_get_type (),
- * or gtk_option_menu_get_type ().
+/* `container_type' must be of GTK_TYPE_MENU_BAR, GTK_TYPE_MENU,
+ * or GTK_TYPE_OPTION_MENU.
*/
GtkItemFactory* gtk_item_factory_new (GtkType container_type,
const gchar *path,
gtk_label_set_justify (label, GTK_VALUE_ENUM (*arg));
break;
default:
- arg->type = GTK_TYPE_INVALID;
break;
}
}
GtkSignalFunc func,
gpointer func_data,
GtkArg *args);
+static GtkType gtk_list_child_type (GtkContainer *container);
static GtkContainerClass *parent_class = NULL;
container_class->add = gtk_list_add;
container_class->remove = gtk_list_remove;
container_class->foreach = gtk_list_foreach;
+ container_class->child_type = gtk_list_child_type;
class->selection_changed = NULL;
class->select_child = gtk_real_list_select_child;
class->unselect_child = gtk_real_list_unselect_child;
}
+static GtkType
+gtk_list_child_type (GtkContainer *container)
+{
+ return GTK_TYPE_LIST_ITEM;
+}
+
static void
gtk_list_init (GtkList *list)
{
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_LIST(obj) (GTK_CHECK_CAST (obj, gtk_list_get_type (), GtkList))
-#define GTK_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, gtk_list_get_type (), GtkListClass))
-#define GTK_IS_LIST(obj) (GTK_CHECK_TYPE (obj, gtk_list_get_type ()))
+#define GTK_TYPE_LIST (gtk_list_get_type ())
+#define GTK_LIST(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_LIST, GtkList))
+#define GTK_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST, GtkListClass))
+#define GTK_IS_LIST(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_LIST))
+#define GTK_IS_LIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST))
typedef struct _GtkList GtkList;
static GtkItemClass *parent_class = NULL;
-guint
+GtkType
gtk_list_item_get_type (void)
{
- static guint list_item_type = 0;
+ static GtkType list_item_type = 0;
if (!list_item_type)
{
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_LIST_ITEM(obj) GTK_CHECK_CAST (obj, gtk_list_item_get_type (), GtkListItem)
-#define GTK_LIST_ITEM_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_list_item_get_type (), GtkListItemClass)
-#define GTK_IS_LIST_ITEM(obj) GTK_CHECK_TYPE (obj, gtk_list_item_get_type ())
+#define GTK_TYPE_LIST_ITEM (gtk_list_item_get_type ())
+#define GTK_LIST_ITEM(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_LIST_ITEM, GtkListItem))
+#define GTK_LIST_ITEM_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST_ITEM, GtkListItemClass))
+#define GTK_IS_LIST_ITEM(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_LIST_ITEM))
+#define GTK_IS_LIST_ITEM_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST_ITEM))
typedef struct _GtkListItem GtkListItem;
};
-guint gtk_list_item_get_type (void);
+GtkType gtk_list_item_get_type (void);
GtkWidget* gtk_list_item_new (void);
GtkWidget* gtk_list_item_new_with_label (const gchar *label);
void gtk_list_item_select (GtkListItem *list_item);
GtkWidget *child);
static GtkWidget *gtk_menu_shell_get_item (GtkMenuShell *menu_shell,
GdkEvent *event);
+static GtkType gtk_menu_shell_child_type (GtkContainer *container);
static GtkContainerClass *parent_class = NULL;
container_class->add = gtk_menu_shell_add;
container_class->remove = gtk_menu_shell_remove;
container_class->foreach = gtk_menu_shell_foreach;
+ container_class->child_type = gtk_menu_shell_child_type;
klass->submenu_placement = GTK_TOP_BOTTOM;
klass->deactivate = gtk_real_menu_shell_deactivate;
klass->selection_done = NULL;
}
+static GtkType
+gtk_menu_shell_child_type (GtkContainer *container)
+{
+ return GTK_TYPE_MENU_ITEM;
+}
+
static void
gtk_menu_shell_init (GtkMenuShell *menu_shell)
{
gtk_misc_set_alignment (misc, misc->xpad, GTK_VALUE_INT (*arg));
break;
default:
- arg->type = GTK_TYPE_INVALID;
break;
}
}
static void gtk_notebook_menu_item_create (GtkNotebook *notebook,
GtkNotebookPage *page,
gint position);
+static GtkType gtk_notebook_child_type (GtkContainer *container);
static GtkContainerClass *parent_class = NULL;
static guint notebook_signals[LAST_SIGNAL] = { 0 };
-guint
+GtkType
gtk_notebook_get_type (void)
{
- static guint notebook_type = 0;
+ static GtkType notebook_type = 0;
if (!notebook_type)
{
container_class->foreach = gtk_notebook_foreach;
container_class->focus = gtk_notebook_focus;
container_class->set_focus_child = gtk_notebook_set_focus_child;
+ container_class->child_type = gtk_notebook_child_type;
class->switch_page = gtk_real_notebook_switch_page;
}
+static GtkType
+gtk_notebook_child_type (GtkContainer *container)
+{
+ return GTK_TYPE_WIDGET;
+}
+
static void
gtk_notebook_init (GtkNotebook *notebook)
{
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_NOTEBOOK(obj) GTK_CHECK_CAST (obj, gtk_notebook_get_type (), GtkNotebook)
-#define GTK_NOTEBOOK_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_notebook_get_type (), GtkNotebookClass)
-#define GTK_IS_NOTEBOOK(obj) GTK_CHECK_TYPE (obj, gtk_notebook_get_type ())
+#define GTK_TYPE_NOTEBOOK (gtk_notebook_get_type ())
+#define GTK_NOTEBOOK(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_NOTEBOOK, GtkNotebook))
+#define GTK_NOTEBOOK_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
+#define GTK_IS_NOTEBOOK(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_NOTEBOOK))
+#define GTK_IS_NOTEBOOK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK))
typedef struct _GtkNotebook GtkNotebook;
struct _GtkNotebook
{
GtkContainer container;
-
+
GtkNotebookPage *cur_page;
GList *children;
GList *first_tab;
GList *focus_tab;
-
+
GtkWidget *menu;
GdkWindow *panel;
-
+
guint32 timer;
-
+
gint16 tab_border;
-
+
guint show_tabs : 1;
guint show_border : 1;
guint tab_pos : 2;
struct _GtkNotebookClass
{
GtkContainerClass parent_class;
-
+
void (* switch_page) (GtkNotebook *notebook,
GtkNotebookPage *page,
gint page_num);
};
-guint gtk_notebook_get_type (void);
+GtkType gtk_notebook_get_type (void);
GtkWidget* gtk_notebook_new (void);
void gtk_notebook_append_page (GtkNotebook *notebook,
GtkWidget *child,
struct _GtkArgInfo
{
- char *name;
+ gchar *name;
GtkType type;
GtkType class_type;
guint arg_flags;
};
+void gtk_object_init_type (void);
static void gtk_object_class_init (GtkObjectClass *klass);
static void gtk_object_init (GtkObject *object);
static void gtk_object_set_arg (GtkObject *object,
if ((arg->name[9 + 2 + 6] != ':') || (arg->name[9 + 2 + 7] != ':'))
{
g_warning ("invalid signal argument: \"%s\"\n", arg->name);
- arg->type = GTK_TYPE_INVALID;
return;
}
gtk_signal_connect (object, arg->name + 9 + 2 + 6 + 2,
if ((arg->name[9 + 2 + 13] != ':') || (arg->name[9 + 2 + 14] != ':'))
{
g_warning ("invalid signal argument: \"%s\"\n", arg->name);
- arg->type = GTK_TYPE_INVALID;
return;
}
gtk_signal_connect_object (object, arg->name + 9 + 2 + 13 + 2,
(GtkObject*) GTK_VALUE_SIGNAL (*arg).d);
break;
default:
- arg->type = GTK_TYPE_INVALID;
break;
}
}
if (!info)
{
- g_warning ("invalid arg name: \"%s\"\n", lookup_name);
+ g_warning ("gtk_object_getv(): invalid arg name: \"%s\"\n",
+ lookup_name);
args[i].type = GTK_TYPE_INVALID;
g_free (lookup_name);
continue;
}
else if (!gtk_type_is_a (object->klass->type, info->class_type))
{
- g_warning ("invalid arg for %s: \"%s\"\n", gtk_type_name (object->klass->type), lookup_name);
+ g_warning ("gtk_object_getv(): invalid arg for %s: \"%s\"\n",
+ gtk_type_name (object->klass->type), lookup_name);
args[i].type = GTK_TYPE_INVALID;
g_free (lookup_name);
continue;
}
else if (! (info->arg_flags & GTK_ARG_READABLE))
{
- g_warning ("arg is not supplied for read-access: \"%s\"\n", lookup_name);
+ g_warning ("gtk_object_getv(): arg is not supplied for read-access: \"%s\"\n",
+ lookup_name);
args[i].type = GTK_TYPE_INVALID;
g_free (lookup_name);
continue;
*arg_flags = NULL;
g_return_val_if_fail (nargs != NULL, NULL);
*nargs = 0;
- g_return_val_if_fail (gtk_type_is_a (class_type, gtk_object_get_type ()), NULL);
+ g_return_val_if_fail (gtk_type_is_a (class_type, GTK_TYPE_OBJECT), NULL);
if (!arg_info_ht)
return NULL;
if (!info)
{
- g_warning ("invalid arg name: \"%s\"\n", lookup_name);
+ g_warning ("gtk_object_setv(): invalid arg name: \"%s\"\n",
+ lookup_name);
arg_ok = FALSE;
}
else if (info->type != args[i].type)
{
- g_warning ("invalid arg type for: \"%s\"\n", lookup_name);
+ g_warning ("gtk_object_setv(): invalid arg type for: \"%s\"\n",
+ lookup_name);
arg_ok = FALSE;
}
else if (!gtk_type_is_a (object->klass->type, info->class_type))
{
- g_warning ("invalid arg for %s: \"%s\"\n", gtk_type_name (object->klass->type), lookup_name);
+ g_warning ("gtk_object_setv(): invalid arg for %s: \"%s\"\n",
+ gtk_type_name (object->klass->type), lookup_name);
arg_ok = FALSE;
}
else if (! (info->arg_flags & GTK_ARG_WRITABLE))
{
- g_warning ("arg is not supplied for write-access: \"%s\"\n", lookup_name);
+ g_warning ("gtk_object_setv(): arg is not supplied for write-access: \"%s\"\n",
+ lookup_name);
arg_ok = FALSE;
}
g_return_if_fail (arg_type > GTK_TYPE_NONE);
g_return_if_fail (arg_id > 0);
g_return_if_fail ((arg_flags & GTK_ARG_READWRITE) != 0);
+ g_return_if_fail ((arg_flags & GTK_ARG_CHILD_ARG) == 0);
+ arg_flags &= GTK_ARG_MASK;
+
arg_part = strchr (arg_name, ':');
if (!arg_part || (arg_part[0] != ':') || (arg_part[1] != ':'))
{
class_type = gtk_type_from_name (class_part);
if (!class_type)
{
- g_warning ("invalid class name in arg: \"%s\"\n", arg_name);
+ g_warning ("gtk_object_add_arg_type(): invalid class name in arg: \"%s\"\n", arg_name);
return;
}
info->name = g_strdup (arg_name);
info->type = arg_type;
info->class_type = class_type;
- info->arg_flags = arg_flags & (GTK_ARG_READABLE | GTK_ARG_WRITABLE);
+ info->arg_flags = arg_flags;
info->arg_id = arg_id;
info->seq_id = ++((GtkObjectClass*) gtk_type_class (class_type))->n_args;
switch (GTK_FUNDAMENTAL_TYPE (type))
{
case GTK_TYPE_INVALID:
- g_warning ("invalid arg name: \"%s\" %x\n", name, type);
+ g_warning ("GTK: invalid arg name: \"%s\" %x\n", name, type);
(void) va_arg (args1, long);
continue;
case GTK_TYPE_NONE:
GTK_ARG_READABLE = 1 << 0,
GTK_ARG_WRITABLE = 1 << 1,
GTK_ARG_CONSTRUCT = 1 << 2,
- GTK_ARG_MASK = 0x03,
+ GTK_ARG_CHILD_ARG = 1 << 3,
+ GTK_ARG_MASK = 0x0f,
+
/* aliases
*/
GTK_ARG_READWRITE = GTK_ARG_READABLE | GTK_ARG_WRITABLE
* (*arg_flags) will be set to point to a newly allocated
* guint array that holds the flags of the args.
* It is the callers response to do a
- * g_free (returned_args); g_free (*acess_masks).
+ * g_free (returned_args); g_free (*arg_flags).
*/
GtkArg* gtk_object_query_args (GtkType class_type,
guint32 **arg_flags,
gpointer user_data);
static void gtk_option_menu_show_all (GtkWidget *widget);
static void gtk_option_menu_hide_all (GtkWidget *widget);
+static GtkType gtk_option_menu_child_type (GtkContainer *container);
static GtkButtonClass *parent_class = NULL;
-guint
+GtkType
gtk_option_menu_get_type (void)
{
- static guint option_menu_type = 0;
+ static GtkType option_menu_type = 0;
if (!option_menu_type)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkButtonClass *button_class;
+ GtkContainerClass *container_class;
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
button_class = (GtkButtonClass*) class;
+ container_class = (GtkContainerClass*) class;
parent_class = gtk_type_class (gtk_button_get_type ());
widget_class->button_press_event = gtk_option_menu_button_press;
widget_class->show_all = gtk_option_menu_show_all;
widget_class->hide_all = gtk_option_menu_hide_all;
+
+ container_class->child_type = gtk_option_menu_child_type;
+}
+
+static GtkType
+gtk_option_menu_child_type (GtkContainer *container)
+{
+ return GTK_TYPE_NONE;
}
static void
if (remove_child)
gtk_option_menu_remove_contents (GTK_OPTION_MENU (widget));
#else
+ remove_child = FALSE;
child = GTK_BUTTON (widget)->child;
child_event = *event;
if (child && GTK_WIDGET_NO_WINDOW (child) &&
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_OPTION_MENU(obj) GTK_CHECK_CAST (obj, gtk_option_menu_get_type (), GtkOptionMenu)
-#define GTK_OPTION_MENU_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_option_menu_get_type (), GtkOptionMenuClass)
-#define GTK_IS_OPTION_MENU(obj) GTK_CHECK_TYPE (obj, gtk_option_menu_get_type ())
+#define GTK_TYPE_OPTION_MENU (gtk_option_menu_get_type ())
+#define GTK_OPTION_MENU(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_OPTION_MENU, GtkOptionMenu))
+#define GTK_OPTION_MENU_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_OPTION_MENU, GtkOptionMenuClass))
+#define GTK_IS_OPTION_MENU(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_OPTION_MENU))
+#define GTK_IS_OPTION_MENU_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_OPTION_MENU))
typedef struct _GtkOptionMenu GtkOptionMenu;
struct _GtkOptionMenu
{
GtkButton button;
-
+
GtkWidget *menu;
GtkWidget *menu_item;
-
+
guint16 width;
guint16 height;
};
};
-guint gtk_option_menu_get_type (void);
+GtkType gtk_option_menu_get_type (void);
GtkWidget* gtk_option_menu_new (void);
GtkWidget* gtk_option_menu_get_menu (GtkOptionMenu *option_menu);
void gtk_option_menu_set_menu (GtkOptionMenu *option_menu,
static void gtk_packer_foreach (GtkContainer *container,
GtkCallback callback,
gpointer callback_data);
+static GtkType gtk_packer_child_type (GtkContainer *container);
static GtkPackerClass *parent_class;
container_class->add = gtk_packer_container_add;
container_class->remove = gtk_packer_remove;
- container_class->foreach = gtk_packer_foreach;
-
+ container_class->foreach = gtk_packer_foreach;
+ container_class->child_type = gtk_packer_child_type;
}
+static GtkType
+gtk_packer_child_type (GtkContainer *container)
+{
+ return GTK_TYPE_WIDGET;
+}
static void
gtk_packer_init (GtkPacker *packer)
if (child->use_default)
{
child->border_width = packer->default_border_width;
- child->padX = packer->default_padX;
- child->padY = packer->default_padY;
- child->iPadX = packer->default_iPadX;
- child->iPadY = packer->default_iPadY;
+ child->pad_x = packer->default_pad_x;
+ child->pad_y = packer->default_pad_y;
+ child->i_pad_x = packer->default_i_pad_x;
+ child->i_pad_y = packer->default_i_pad_y;
gtk_widget_queue_resize(GTK_WIDGET(packer));
}
list = g_list_next(list);
}
}
void
-gtk_packer_set_default_pad(GtkPacker *packer, gint padX ,gint padY)
+gtk_packer_set_default_pad(GtkPacker *packer,
+ guint pad_x,
+ guint pad_y)
{
g_return_if_fail (packer != NULL);
g_return_if_fail (GTK_IS_PACKER (packer));
- if (packer->default_padX != padX ||
- packer->default_padY != padY)
+ if (packer->default_pad_x != pad_x ||
+ packer->default_pad_y != pad_y)
{
- packer->default_padX = padX;;
- packer->default_padY = padY;;
- redo_defaults_children(packer);
+ packer->default_pad_x = pad_x;
+ packer->default_pad_y = pad_y;
+ redo_defaults_children (packer);
}
}
void
-gtk_packer_set_default_ipad(GtkPacker *packer, gint iPadX ,gint iPadY)
+gtk_packer_set_default_ipad(GtkPacker *packer,
+ guint i_pad_x,
+ guint i_pad_y)
{
g_return_if_fail (packer != NULL);
g_return_if_fail (GTK_IS_PACKER (packer));
- if (packer->default_iPadX != iPadX ||
- packer->default_iPadY != iPadY) {
+ if (packer->default_i_pad_x != i_pad_x ||
+ packer->default_i_pad_y != i_pad_y) {
- packer->default_iPadX = iPadX;;
- packer->default_iPadY = iPadY;;
- redo_defaults_children(packer);
+ packer->default_i_pad_x = i_pad_x;
+ packer->default_i_pad_y = i_pad_y;
+ redo_defaults_children (packer);
}
}
g_return_if_fail (packer != NULL);
g_return_if_fail (GTK_IS_PACKER (packer));
g_return_if_fail (child != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (child));
pchild = (GtkPackerChild*) g_malloc(sizeof(GtkPackerChild));
pchild->use_default = 1;
pchild->border_width = packer->default_border_width;
- pchild->padX = packer->default_padX;
- pchild->padY = packer->default_padY;
- pchild->iPadX = packer->default_iPadX;
- pchild->iPadY = packer->default_iPadY;
+ pchild->pad_x = packer->default_pad_x;
+ pchild->pad_y = packer->default_pad_y;
+ pchild->i_pad_x = packer->default_i_pad_x;
+ pchild->i_pad_y = packer->default_i_pad_y;
packer->children = g_list_append(packer->children, (gpointer) pchild);
GtkAnchorType anchor,
GtkPackerOptions options,
guint border_width,
- gint padX,
- gint padY,
- gint iPadX,
- gint iPadY)
+ guint pad_x,
+ guint pad_y,
+ guint i_pad_x,
+ guint i_pad_y)
{
GtkPackerChild *pchild;
pchild->use_default = 0;
pchild->border_width = border_width;
- pchild->padX = padX;
- pchild->padY = padY;
- pchild->iPadX = iPadX;
- pchild->iPadY = iPadY;
+ pchild->pad_x = pad_x;
+ pchild->pad_y = pad_y;
+ pchild->i_pad_x = i_pad_x;
+ pchild->i_pad_y = i_pad_y;
packer->children = g_list_append(packer->children, (gpointer) pchild);
GtkAnchorType anchor,
GtkPackerOptions options,
guint border_width,
- gint padX,
- gint padY,
- gint ipadX,
- gint ipadY)
+ guint pad_x,
+ guint pad_y,
+ guint i_pad_x,
+ guint i_pad_y)
{
GList *list;
GtkPackerChild *pchild;
pchild->use_default = 0;
pchild->border_width = border_width;
- pchild->padX = padX;
- pchild->padY = padY;
- pchild->iPadX = ipadX;
- pchild->iPadY = ipadY;
+ pchild->pad_x = pad_x;
+ pchild->pad_y = pad_y;
+ pchild->i_pad_x = i_pad_x;
+ pchild->i_pad_y = i_pad_y;
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (packer))
gtk_widget_queue_resize (child);
maxWidth = MAX (maxWidth,
(child->widget->requisition.width +
2 * child->border_width +
- child->padX + child->iPadX +
+ child->pad_x + child->i_pad_x +
width));
height += (child->widget->requisition.height +
2 * child->border_width +
- child->padY + child->iPadY);
+ child->pad_y + child->i_pad_y);
}
else
{
maxHeight = MAX (maxHeight,
(child->widget->requisition.height +
2 * child->border_width +
- child->padY + child->iPadY +
+ child->pad_y + child->i_pad_y +
height));
width += (child->widget->requisition.width +
2 * child->border_width +
- child->padX + child->iPadX);
+ child->pad_x + child->i_pad_x);
}
}
widget = child->widget;
childHeight = (widget->requisition.height +
2 * child->border_width +
- child->iPadY +
- child->padY);
+ child->i_pad_y +
+ child->pad_y);
if ((child->side == GTK_SIDE_LEFT) || (child->side == GTK_SIDE_RIGHT))
{
curExpand = (cavityHeight - childHeight)/numExpand;
widget = child->widget;
childWidth = (widget->requisition.width +
2 * child->border_width +
- child->iPadX +
- child->padX);
+ child->i_pad_x +
+ child->pad_x);
if ((child->side == GTK_SIDE_TOP) || (child->side == GTK_SIDE_BOTTOM))
{
frameWidth = cavityWidth;
frameHeight = (child->widget->requisition.height +
2 * child->border_width +
- child->padY +
- child->iPadY);
+ child->pad_y +
+ child->i_pad_y);
if (child->options & GTK_PACK_EXPAND)
frameHeight += YExpansion(list, cavityHeight);
cavityHeight -= frameHeight;
frameHeight = cavityHeight;
frameWidth = (child->widget->requisition.width +
2 * child->border_width +
- child->padX +
- child->iPadX);
+ child->pad_x +
+ child->i_pad_x);
if (child->options & GTK_PACK_EXPAND)
frameWidth += XExpansion(list, cavityWidth);
cavityWidth -= frameWidth;
}
}
- borderX = child->padX + 2 * child->border_width;
- borderY = child->padY + 2 * child->border_width;
+ borderX = child->pad_x + 2 * child->border_width;
+ borderY = child->pad_y + 2 * child->border_width;
width = (child->widget->requisition.width +
2 * child->border_width +
- child->iPadX);
+ child->i_pad_x);
if ((child->options & GTK_FILL_X) || (width > (frameWidth - borderX)))
width = frameWidth - borderX;
height = (child->widget->requisition.height +
2 * child->border_width +
- child->iPadY);
+ child->i_pad_y);
if ((child->options & GTK_FILL_Y) || (height > (frameHeight - borderY)))
height = frameHeight - borderY;
typedef struct _GtkPackerClass GtkPackerClass;
typedef struct _GtkPackerChild GtkPackerChild;
-typedef enum {
+typedef enum
+{
GTK_PACK_EXPAND = 1 << 0, /*< nick=expand >*/
GTK_FILL_X = 1 << 1,
GTK_FILL_Y = 1 << 2
} GtkPackerOptions;
-typedef enum {
+typedef enum
+{
GTK_SIDE_TOP,
GTK_SIDE_BOTTOM,
GTK_SIDE_LEFT,
GTK_SIDE_RIGHT
} GtkSideType;
-typedef enum {
- GTK_ANCHOR_CENTER,
- GTK_ANCHOR_N,
- GTK_ANCHOR_NW,
- GTK_ANCHOR_NE,
- GTK_ANCHOR_S,
- GTK_ANCHOR_SW,
- GTK_ANCHOR_SE,
- GTK_ANCHOR_W,
- GTK_ANCHOR_E
+typedef enum
+{
+ GTK_ANCHOR_CENTER,
+ GTK_ANCHOR_NORTH,
+ GTK_ANCHOR_NORTH_WEST,
+ GTK_ANCHOR_NORTH_EAST,
+ GTK_ANCHOR_SOUTH,
+ GTK_ANCHOR_SOUTH_WEST,
+ GTK_ANCHOR_SOUTH_EAST,
+ GTK_ANCHOR_WEST,
+ GTK_ANCHOR_EAST,
+ GTK_ANCHOR_N = GTK_ANCHOR_NORTH,
+ GTK_ANCHOR_NW = GTK_ANCHOR_NORTH_WEST,
+ GTK_ANCHOR_NE = GTK_ANCHOR_NORTH_EAST,
+ GTK_ANCHOR_S = GTK_ANCHOR_SOUTH,
+ GTK_ANCHOR_SW = GTK_ANCHOR_SOUTH_WEST,
+ GTK_ANCHOR_SE = GTK_ANCHOR_SOUTH_EAST,
+ GTK_ANCHOR_W = GTK_ANCHOR_WEST,
+ GTK_ANCHOR_E = GTK_ANCHOR_EAST
} GtkAnchorType;
struct _GtkPackerChild
guint use_default : 1;
- guint border_width;
- gint padX;
- gint padY;
- gint iPadX;
- gint iPadY;
+ guint border_width : 16;
+ guint pad_x : 16;
+ guint pad_y : 16;
+ guint i_pad_x : 16;
+ guint i_pad_y : 16;
};
struct _GtkPacker
guint spacing;
- guint default_border_width;
- gint default_padX;
- gint default_padY;
- gint default_iPadX;
- gint default_iPadY;
+ guint default_border_width : 16;
+ guint default_pad_x : 16;
+ guint default_pad_y : 16;
+ guint default_i_pad_x : 16;
+ guint default_i_pad_y : 16;
};
struct _GtkPackerClass
GtkAnchorType anchor,
GtkPackerOptions options,
guint border_width,
- gint padX,
- gint padY,
- gint ipadX,
- gint ipadY);
+ guint pad_x,
+ guint pad_y,
+ guint i_pad_x,
+ guint i_pad_y);
void gtk_packer_configure (GtkPacker *packer,
GtkWidget *child,
GtkSideType side,
GtkAnchorType anchor,
GtkPackerOptions options,
guint border_width,
- gint padX,
- gint padY,
- gint ipadX,
- gint ipadY);
+ guint pad_x,
+ guint pad_y,
+ guint i_pad_x,
+ guint i_pad_y);
void gtk_packer_set_spacing (GtkPacker *packer,
guint spacing);
void gtk_packer_set_default_border_width (GtkPacker *packer,
guint border);
void gtk_packer_set_default_pad (GtkPacker *packer,
- gint padX,
- gint padY);
+ guint pad_x,
+ guint pad_y);
void gtk_packer_set_default_ipad (GtkPacker *packer,
- gint iPadX,
- gint iPadY);
+ guint i_pad_x,
+ guint i_pad_y);
#ifdef __cplusplus
static void gtk_paned_foreach (GtkContainer *container,
GtkCallback callback,
gpointer callback_data);
+static GtkType gtk_paned_child_type (GtkContainer *container);
static GtkContainerClass *parent_class = NULL;
container_class->add = gtk_paned_add;
container_class->remove = gtk_paned_remove;
container_class->foreach = gtk_paned_foreach;
+ container_class->child_type = gtk_paned_child_type;
+}
+
+static GtkType
+gtk_paned_child_type (GtkContainer *container)
+{
+ if (!GTK_PANED (container)->child1 || !GTK_PANED (container)->child2)
+ return GTK_TYPE_WIDGET;
+ else
+ return GTK_TYPE_NONE;
}
static void
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_PANED(obj) GTK_CHECK_CAST (obj, gtk_paned_get_type (), GtkPaned)
-#define GTK_PANED_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_paned_get_type (), GtkPanedClass)
-#define GTK_IS_PANED(obj) GTK_CHECK_TYPE (obj, gtk_paned_get_type ())
+#define GTK_TYPE_PANED (gtk_paned_get_type ())
+#define GTK_PANED(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_PANED, GtkPaned))
+#define GTK_PANED_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_PANED, GtkPanedClass))
+#define GTK_IS_PANED(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_PANED))
+#define GTK_IS_PANED_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PANED))
typedef struct _GtkPaned GtkPaned;
struct _GtkPaned
{
GtkContainer container;
-
+
GtkWidget *child1;
GtkWidget *child2;
-
+
GdkWindow *handle;
GdkCursor *cursor;
GdkRectangle groove_rectangle;
GdkGC *xor_gc;
-
+
guint16 handle_size;
guint16 gutter_size;
gint child1_size;
guint position_set : 1;
guint in_drag : 1;
-
+
gint16 handle_xpos;
gint16 handle_ypos;
};
};
-guint gtk_paned_get_type (void);
-void gtk_paned_add1 (GtkPaned *paned, GtkWidget *child);
-void gtk_paned_add2 (GtkPaned *paned, GtkWidget *child);
-void gtk_paned_handle_size (GtkPaned *paned, guint16 size);
-void gtk_paned_gutter_size (GtkPaned *paned, guint16 size);
+GtkType gtk_paned_get_type (void);
+void gtk_paned_add1 (GtkPaned *paned,
+ GtkWidget *child);
+void gtk_paned_add2 (GtkPaned *paned,
+ GtkWidget *child);
+void gtk_paned_handle_size (GtkPaned *paned,
+ guint16 size);
+void gtk_paned_gutter_size (GtkPaned *paned,
+ guint16 size);
#ifdef __cplusplus
}
static GtkCheckButtonClass *parent_class = NULL;
-guint
+GtkType
gtk_radio_button_get_type (void)
{
- static guint radio_button_type = 0;
+ static GtkType radio_button_type = 0;
if (!radio_button_type)
{
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_RADIO_BUTTON(obj) GTK_CHECK_CAST (obj, gtk_radio_button_get_type (), GtkRadioButton)
-#define GTK_RADIO_BUTTON_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_radio_button_get_type (), GtkRadioButtonClass)
-#define GTK_IS_RADIO_BUTTON(obj) GTK_CHECK_TYPE (obj, gtk_radio_button_get_type ())
+#define GTK_TYPE_RADIO_BUTTON (gtk_radio_button_get_type ())
+#define GTK_RADIO_BUTTON(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_RADIO_BUTTON, GtkRadioButton))
+#define GTK_RADIO_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_RADIO_BUTTON, GtkRadioButtonClass))
+#define GTK_IS_RADIO_BUTTON(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_RADIO_BUTTON))
+#define GTK_IS_RADIO_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RADIO_BUTTON))
-typedef struct _GtkRadioButton GtkRadioButton;
+typedef struct _GtkRadioButton GtkRadioButton;
typedef struct _GtkRadioButtonClass GtkRadioButtonClass;
struct _GtkRadioButton
{
GtkCheckButton check_button;
-
+
GSList *group;
};
};
-guint gtk_radio_button_get_type (void);
-GtkWidget* gtk_radio_button_new (GSList *group);
+GtkType gtk_radio_button_get_type (void);
+GtkWidget* gtk_radio_button_new (GSList *group);
GtkWidget* gtk_radio_button_new_from_widget (GtkRadioButton *group);
-GtkWidget* gtk_radio_button_new_with_label (GSList *group,
+GtkWidget* gtk_radio_button_new_with_label (GSList *group,
const gchar *label);
GtkWidget* gtk_radio_button_new_with_label_from_widget (GtkRadioButton *group,
- const gchar *label);
-GSList* gtk_radio_button_group (GtkRadioButton *radio_button);
-void gtk_radio_button_set_group (GtkRadioButton *radio_button,
- GSList *group);
+ const gchar *label);
+GSList* gtk_radio_button_group (GtkRadioButton *radio_button);
+void gtk_radio_button_set_group (GtkRadioButton *radio_button,
+ GSList *group);
#ifdef __cplusplus
GdkRectangle *area);
-guint
+GtkType
gtk_radio_menu_item_get_type (void)
{
- static guint radio_menu_item_type = 0;
+ static GtkType radio_menu_item_type = 0;
if (!radio_menu_item_type)
{
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_RADIO_MENU_ITEM(obj) GTK_CHECK_CAST (obj, gtk_radio_menu_item_get_type (), GtkRadioMenuItem)
-#define GTK_RADIO_MENU_ITEM_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_radio_menu_item_get_type (), GtkRadioMenuItemClass)
-#define GTK_IS_RADIO_MENU_ITEM(obj) GTK_CHECK_TYPE (obj, gtk_radio_menu_item_get_type ())
+#define GTK_TYPE_RADIO_MENU_ITEM (gtk_radio_menu_item_get_type ())
+#define GTK_RADIO_MENU_ITEM(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem))
+#define GTK_RADIO_MENU_ITEM_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItemClass))
+#define GTK_IS_RADIO_MENU_ITEM(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_RADIO_MENU_ITEM))
+#define GTK_IS_RADIO_MENU_ITEM_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RADIO_MENU_ITEM))
typedef struct _GtkRadioMenuItem GtkRadioMenuItem;
struct _GtkRadioMenuItem
{
GtkCheckMenuItem check_menu_item;
-
+
GSList *group;
};
};
-guint gtk_radio_menu_item_get_type (void);
-GtkWidget* gtk_radio_menu_item_new (GSList *group);
-GtkWidget* gtk_radio_menu_item_new_with_label (GSList *group,
- const gchar *label);
-GSList* gtk_radio_menu_item_group (GtkRadioMenuItem *radio_menu_item);
-void gtk_radio_menu_item_set_group (GtkRadioMenuItem *radio_menu_item,
- GSList *group);
+GtkType gtk_radio_menu_item_get_type (void);
+GtkWidget* gtk_radio_menu_item_new (GSList *group);
+GtkWidget* gtk_radio_menu_item_new_with_label (GSList *group,
+ const gchar *label);
+GSList* gtk_radio_menu_item_group (GtkRadioMenuItem *radio_menu_item);
+void gtk_radio_menu_item_set_group (GtkRadioMenuItem *radio_menu_item,
+ GSList *group);
#ifdef __cplusplus
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
*/
#include "gtktable.h"
+enum
+{
+ ARG_0,
+ ARG_N_ROWS,
+ ARG_N_COLUMNS,
+ ARG_COLUMN_SPACING,
+ ARG_ROW_SPACING,
+ ARG_HOMOGENEOUS,
+};
+
+enum
+{
+ CHILD_ARG_0,
+ CHILD_ARG_LEFT_ATTACH,
+ CHILD_ARG_RIGHT_ATTACH,
+ CHILD_ARG_TOP_ATTACH,
+ CHILD_ARG_BOTTOM_ATTACH,
+ CHILD_ARG_X_OPTIONS,
+ CHILD_ARG_Y_OPTIONS,
+ CHILD_ARG_X_PADDING,
+ CHILD_ARG_Y_PADDING
+};
+
static void gtk_table_class_init (GtkTableClass *klass);
-static void gtk_table_init (GtkTable *table);
-static void gtk_table_finalize (GtkObject *object);
-static void gtk_table_map (GtkWidget *widget);
-static void gtk_table_unmap (GtkWidget *widget);
-static void gtk_table_draw (GtkWidget *widget,
+static void gtk_table_init (GtkTable *table);
+static void gtk_table_finalize (GtkObject *object);
+static void gtk_table_map (GtkWidget *widget);
+static void gtk_table_unmap (GtkWidget *widget);
+static void gtk_table_draw (GtkWidget *widget,
GdkRectangle *area);
-static gint gtk_table_expose (GtkWidget *widget,
+static gint gtk_table_expose (GtkWidget *widget,
GdkEventExpose *event);
-static void gtk_table_size_request (GtkWidget *widget,
+static void gtk_table_size_request (GtkWidget *widget,
GtkRequisition *requisition);
-static void gtk_table_size_allocate (GtkWidget *widget,
+static void gtk_table_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
-static void gtk_table_add (GtkContainer *container,
- GtkWidget *widget);
-static void gtk_table_remove (GtkContainer *container,
- GtkWidget *widget);
-static void gtk_table_foreach (GtkContainer *container,
+static void gtk_table_add (GtkContainer *container,
+ GtkWidget *widget);
+static void gtk_table_remove (GtkContainer *container,
+ GtkWidget *widget);
+static void gtk_table_foreach (GtkContainer *container,
GtkCallback callback,
- gpointer callback_data);
-
-static void gtk_table_size_request_init (GtkTable *table);
+ gpointer callback_data);
+static void gtk_table_get_arg (GtkObject *object,
+ GtkArg *arg,
+ guint arg_id);
+static void gtk_table_set_arg (GtkObject *object,
+ GtkArg *arg,
+ guint arg_id);
+static void gtk_table_set_child_arg (GtkContainer *container,
+ GtkWidget *child,
+ GtkArg *arg,
+ guint arg_id);
+static void gtk_table_get_child_arg (GtkContainer *container,
+ GtkWidget *child,
+ GtkArg *arg,
+ guint arg_id);
+static GtkType gtk_table_child_type (GtkContainer *container);
+
+
+static void gtk_table_size_request_init (GtkTable *table);
static void gtk_table_size_request_pass1 (GtkTable *table);
static void gtk_table_size_request_pass2 (GtkTable *table);
static void gtk_table_size_request_pass3 (GtkTable *table);
static GtkContainerClass *parent_class = NULL;
-guint
+GtkType
gtk_table_get_type (void)
{
- static guint table_type = 0;
-
+ static GtkType table_type = 0;
+
if (!table_type)
{
GtkTypeInfo table_info =
sizeof (GtkTableClass),
(GtkClassInitFunc) gtk_table_class_init,
(GtkObjectInitFunc) gtk_table_init,
- (GtkArgSetFunc) NULL,
- (GtkArgGetFunc) NULL,
+ gtk_table_set_arg,
+ gtk_table_get_arg,
};
-
+
table_type = gtk_type_unique (gtk_container_get_type (), &table_info);
}
-
+
return table_type;
}
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
-
+
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
container_class = (GtkContainerClass*) class;
-
+
parent_class = gtk_type_class (gtk_container_get_type ());
+
+ gtk_object_add_arg_type ("GtkTable::n_rows", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_N_ROWS);
+ gtk_object_add_arg_type ("GtkTable::n_columns", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_N_COLUMNS);
+ gtk_object_add_arg_type ("GtkTable::row_spacing", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_ROW_SPACING);
+ gtk_object_add_arg_type ("GtkTable::column_spacing", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_COLUMN_SPACING);
+ gtk_object_add_arg_type ("GtkTable::homogeneous", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HOMOGENEOUS);
+ gtk_container_add_child_arg_type ("GtkTable::left_attach", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_LEFT_ATTACH);
+ gtk_container_add_child_arg_type ("GtkTable::right_attach", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_RIGHT_ATTACH);
+ gtk_container_add_child_arg_type ("GtkTable::top_attach", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_TOP_ATTACH);
+ gtk_container_add_child_arg_type ("GtkTable::bottom_attach", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_BOTTOM_ATTACH);
+ gtk_container_add_child_arg_type ("GtkTable::x_options", GTK_TYPE_ATTACH_OPTIONS, GTK_ARG_READWRITE, CHILD_ARG_X_OPTIONS);
+ gtk_container_add_child_arg_type ("GtkTable::y_options", GTK_TYPE_ATTACH_OPTIONS, GTK_ARG_READWRITE, CHILD_ARG_Y_OPTIONS);
+ gtk_container_add_child_arg_type ("GtkTable::x_padding", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_X_PADDING);
+ gtk_container_add_child_arg_type ("GtkTable::y_padding", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_Y_PADDING);
object_class->finalize = gtk_table_finalize;
-
+
widget_class->map = gtk_table_map;
widget_class->unmap = gtk_table_unmap;
widget_class->draw = gtk_table_draw;
widget_class->expose_event = gtk_table_expose;
widget_class->size_request = gtk_table_size_request;
widget_class->size_allocate = gtk_table_size_allocate;
-
+
container_class->add = gtk_table_add;
container_class->remove = gtk_table_remove;
container_class->foreach = gtk_table_foreach;
+ container_class->child_type = gtk_table_child_type;
+ container_class->set_child_arg = gtk_table_set_child_arg;
+ container_class->get_child_arg = gtk_table_get_child_arg;
+}
+
+static GtkType
+gtk_table_child_type (GtkContainer *container)
+{
+ return GTK_TYPE_WIDGET;
}
static void
-gtk_table_init (GtkTable *table)
+gtk_table_get_arg (GtkObject *object,
+ GtkArg *arg,
+ guint arg_id)
{
- GTK_WIDGET_SET_FLAGS (table, GTK_NO_WINDOW | GTK_BASIC);
+ GtkTable *table;
- table->children = NULL;
- table->rows = NULL;
- table->cols = NULL;
- table->nrows = 0;
- table->ncols = 0;
- table->homogeneous = FALSE;
+ table = GTK_TABLE (object);
+
+ switch (arg_id)
+ {
+ case ARG_N_ROWS:
+ GTK_VALUE_UINT (*arg) = table->nrows;
+ break;
+ case ARG_N_COLUMNS:
+ GTK_VALUE_UINT (*arg) = table->ncols;
+ break;
+ case ARG_ROW_SPACING:
+ GTK_VALUE_UINT (*arg) = table->row_spacing;
+ break;
+ case ARG_COLUMN_SPACING:
+ GTK_VALUE_UINT (*arg) = table->column_spacing;
+ break;
+ case ARG_HOMOGENEOUS:
+ GTK_VALUE_BOOL (*arg) = table->homogeneous;
+ break;
+ default:
+ arg->type = GTK_TYPE_INVALID;
+ break;
+ }
}
static void
-gtk_table_init_rows (GtkTable *table, int start, int end)
+gtk_table_set_arg (GtkObject *object,
+ GtkArg *arg,
+ guint arg_id)
{
- const int spacing = table->row_spacing;
- int row;
+ GtkTable *table;
+
+ table = GTK_TABLE (object);
- for (row = start; row < end; row++)
+ switch (arg_id)
{
- table->rows[row].requisition = 0;
- table->rows[row].allocation = 0;
- table->rows[row].spacing = spacing;
- table->rows[row].need_expand = 0;
- table->rows[row].need_shrink = 0;
- table->rows[row].expand = 0;
- table->rows[row].shrink = 0;
+ case ARG_N_ROWS:
+ gtk_table_resize (table, GTK_VALUE_UINT (*arg), table->ncols);
+ break;
+ case ARG_N_COLUMNS:
+ gtk_table_resize (table, table->nrows, GTK_VALUE_UINT (*arg));
+ break;
+ case ARG_ROW_SPACING:
+ gtk_table_set_row_spacings (table, GTK_VALUE_UINT (*arg));
+ break;
+ case ARG_COLUMN_SPACING:
+ gtk_table_set_col_spacings (table, GTK_VALUE_UINT (*arg));
+ break;
+ case ARG_HOMOGENEOUS:
+ gtk_table_set_homogeneous (table, GTK_VALUE_BOOL (*arg));
+ break;
+ default:
+ break;
}
}
static void
-gtk_table_init_cols (GtkTable *table, int start, int end)
+gtk_table_set_child_arg (GtkContainer *container,
+ GtkWidget *child,
+ GtkArg *arg,
+ guint arg_id)
{
- const int spacing = table->column_spacing;
- int col;
-
- for (col = start; col < end; col++)
+ GtkTable *table;
+ GtkTableChild *table_child;
+ GList *list;
+
+ table = GTK_TABLE (container);
+ table_child = NULL;
+ for (list = table->children; list; list = list->next)
+ {
+ table_child = list->data;
+
+ if (table_child->widget == child)
+ break;
+ }
+ if (!list)
+ return;
+
+ switch (arg_id)
{
- table->cols[col].requisition = 0;
- table->cols[col].allocation = 0;
- table->cols[col].spacing = spacing;
- table->cols[col].need_expand = 0;
- table->cols[col].need_shrink = 0;
- table->cols[col].expand = 0;
- table->cols[col].shrink = 0;
+ case CHILD_ARG_LEFT_ATTACH:
+ if (GTK_VALUE_UINT (*arg) < table_child->right_attach)
+ table_child->left_attach = GTK_VALUE_UINT (*arg);
+ break;
+ case CHILD_ARG_RIGHT_ATTACH:
+ if (GTK_VALUE_UINT (*arg) > table_child->left_attach)
+ table_child->right_attach = GTK_VALUE_UINT (*arg);
+ if (table_child->right_attach >= table->ncols)
+ gtk_table_resize (table, table->ncols, table_child->right_attach + 1);
+ break;
+ case CHILD_ARG_TOP_ATTACH:
+ if (GTK_VALUE_UINT (*arg) < table_child->bottom_attach)
+ table_child->top_attach = GTK_VALUE_UINT (*arg);
+ break;
+ case CHILD_ARG_BOTTOM_ATTACH:
+ if (GTK_VALUE_UINT (*arg) > table_child->top_attach)
+ table_child->bottom_attach = GTK_VALUE_UINT (*arg);
+ if (table_child->bottom_attach >= table->nrows)
+ gtk_table_resize (table, table_child->bottom_attach + 1, table->ncols);
+ break;
+ case CHILD_ARG_X_OPTIONS:
+ table_child->xexpand = (GTK_VALUE_FLAGS (*arg) & GTK_EXPAND) != 0;
+ table_child->xshrink = (GTK_VALUE_FLAGS (*arg) & GTK_SHRINK) != 0;
+ table_child->xfill = (GTK_VALUE_FLAGS (*arg) & GTK_FILL) != 0;
+ break;
+ case CHILD_ARG_Y_OPTIONS:
+ table_child->yexpand = (GTK_VALUE_FLAGS (*arg) & GTK_EXPAND) != 0;
+ table_child->yshrink = (GTK_VALUE_FLAGS (*arg) & GTK_SHRINK) != 0;
+ table_child->yfill = (GTK_VALUE_FLAGS (*arg) & GTK_FILL) != 0;
+ break;
+ case CHILD_ARG_X_PADDING:
+ table_child->xpadding = GTK_VALUE_UINT (*arg);
+ break;
+ case CHILD_ARG_Y_PADDING:
+ table_child->ypadding = GTK_VALUE_UINT (*arg);
+ break;
+ default:
+ break;
}
+ if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (table))
+ gtk_widget_queue_resize (GTK_WIDGET (table));
}
-GtkWidget*
-gtk_table_new (gint rows,
- gint columns,
- gint homogeneous)
+static void
+gtk_table_get_child_arg (GtkContainer *container,
+ GtkWidget *child,
+ GtkArg *arg,
+ guint arg_id)
{
GtkTable *table;
+ GtkTableChild *table_child;
+ GList *list;
- table = gtk_type_new (gtk_table_get_type ());
+ table = GTK_TABLE (container);
+ table_child = NULL;
+ for (list = table->children; list; list = list->next)
+ {
+ table_child = list->data;
- table->nrows = rows;
- table->ncols = columns;
- table->homogeneous = (homogeneous ? TRUE : FALSE);
+ if (table_child->widget == child)
+ break;
+ }
+ if (!list)
+ return;
+
+ switch (arg_id)
+ {
+ case CHILD_ARG_LEFT_ATTACH:
+ GTK_VALUE_UINT (*arg) = table_child->left_attach;
+ break;
+ case CHILD_ARG_RIGHT_ATTACH:
+ GTK_VALUE_UINT (*arg) = table_child->right_attach;
+ break;
+ case CHILD_ARG_TOP_ATTACH:
+ GTK_VALUE_UINT (*arg) = table_child->top_attach;
+ break;
+ case CHILD_ARG_BOTTOM_ATTACH:
+ GTK_VALUE_UINT (*arg) = table_child->bottom_attach;
+ break;
+ case CHILD_ARG_X_OPTIONS:
+ GTK_VALUE_FLAGS (*arg) = (table_child->xexpand * GTK_EXPAND |
+ table_child->xshrink * GTK_SHRINK |
+ table_child->xfill * GTK_FILL);
+ break;
+ case CHILD_ARG_Y_OPTIONS:
+ GTK_VALUE_FLAGS (*arg) = (table_child->yexpand * GTK_EXPAND |
+ table_child->yshrink * GTK_SHRINK |
+ table_child->yfill * GTK_FILL);
+ break;
+ case CHILD_ARG_X_PADDING:
+ GTK_VALUE_UINT (*arg) = table_child->xpadding;
+ break;
+ case CHILD_ARG_Y_PADDING:
+ GTK_VALUE_UINT (*arg) = table_child->ypadding;
+ break;
+ default:
+ arg->type = GTK_TYPE_INVALID;
+ break;
+ }
+}
+
+static void
+gtk_table_init (GtkTable *table)
+{
+ GTK_WIDGET_SET_FLAGS (table, GTK_NO_WINDOW | GTK_BASIC);
+
+ table->children = NULL;
+ table->rows = NULL;
+ table->cols = NULL;
+ table->nrows = 0;
+ table->ncols = 0;
table->column_spacing = 0;
table->row_spacing = 0;
-
- table->rows = g_new (GtkTableRowCol, table->nrows);
- table->cols = g_new (GtkTableRowCol, table->ncols);
+ table->homogeneous = FALSE;
+}
+
+GtkWidget*
+gtk_table_new (guint rows,
+ guint columns,
+ gboolean homogeneous)
+{
+ GtkTable *table;
- gtk_table_init_rows (table, 0, table->nrows);
- gtk_table_init_cols (table, 0, table->ncols);
+ g_return_val_if_fail (rows >= 1, NULL);
+ g_return_val_if_fail (columns >= 1, NULL);
+
+ table = gtk_type_new (gtk_table_get_type ());
+
+ table->homogeneous = (homogeneous ? TRUE : FALSE);
+ gtk_table_resize (table, rows, columns);
+
return GTK_WIDGET (table);
}
-static void
-gtk_table_expand_cols (GtkTable *table, int new_max)
+void
+gtk_table_resize (GtkTable *table,
+ guint n_rows,
+ guint n_cols)
{
- table->cols = g_realloc (table->cols, new_max * sizeof (GtkTableRowCol));
- gtk_table_init_cols (table, table->ncols, new_max);
- table->ncols = new_max;
-}
+ g_return_if_fail (table != NULL);
+ g_return_if_fail (GTK_IS_TABLE (table));
-static void
-gtk_table_expand_rows (GtkTable *table, int new_max)
-{
- table->rows = g_realloc (table->rows, new_max * sizeof (GtkTableRowCol));
- gtk_table_init_rows (table, table->nrows, new_max);
- table->nrows = new_max;
+ n_rows = MAX (n_rows, 1);
+ n_cols = MAX (n_cols, 1);
+
+ if (n_rows != table->nrows ||
+ n_cols != table->ncols)
+ {
+ GList *list;
+
+ for (list = table->children; list; list = list->next)
+ {
+ GtkTableChild *child;
+
+ child = list->data;
+
+ n_rows = MAX (n_rows, child->bottom_attach + 1);
+ n_cols = MAX (n_cols, child->right_attach + 1);
+ }
+
+ if (n_rows != table->nrows)
+ {
+ guint i;
+
+ i = table->nrows;
+ table->nrows = n_rows;
+ table->rows = g_realloc (table->rows, table->nrows * sizeof (GtkTableRowCol));
+
+ for (; i < table->nrows; i++)
+ {
+ table->rows[i].requisition = 0;
+ table->rows[i].allocation = 0;
+ table->rows[i].spacing = table->row_spacing;
+ table->rows[i].need_expand = 0;
+ table->rows[i].need_shrink = 0;
+ table->rows[i].expand = 0;
+ table->rows[i].shrink = 0;
+ }
+ }
+
+ if (n_cols != table->ncols)
+ {
+ guint i;
+
+ i = table->ncols;
+ table->ncols = n_cols;
+ table->cols = g_realloc (table->cols, table->ncols * sizeof (GtkTableRowCol));
+
+ for (; i < table->ncols; i++)
+ {
+ table->cols[i].requisition = 0;
+ table->cols[i].allocation = 0;
+ table->cols[i].spacing = table->column_spacing;
+ table->cols[i].need_expand = 0;
+ table->cols[i].need_shrink = 0;
+ table->cols[i].expand = 0;
+ table->cols[i].shrink = 0;
+ }
+ }
+ }
}
void
-gtk_table_attach (GtkTable *table,
- GtkWidget *child,
- gint left_attach,
- gint right_attach,
- gint top_attach,
- gint bottom_attach,
- gint xoptions,
- gint yoptions,
- gint xpadding,
- gint ypadding)
+gtk_table_attach (GtkTable *table,
+ GtkWidget *child,
+ guint left_attach,
+ guint right_attach,
+ guint top_attach,
+ guint bottom_attach,
+ GtkAttachOptions xoptions,
+ GtkAttachOptions yoptions,
+ guint xpadding,
+ guint ypadding)
{
GtkTableChild *table_child;
g_return_if_fail (table != NULL);
g_return_if_fail (GTK_IS_TABLE (table));
g_return_if_fail (child != NULL);
-
- g_return_if_fail (left_attach >= 0);
+ g_return_if_fail (GTK_IS_WIDGET (child));
+ g_return_if_fail (child->parent == NULL);
+
+ /* g_return_if_fail (left_attach >= 0); */
g_return_if_fail (left_attach < right_attach);
- g_return_if_fail (top_attach >= 0);
+ /* g_return_if_fail (top_attach >= 0); */
g_return_if_fail (top_attach < bottom_attach);
-
+
if (right_attach >= table->ncols)
- gtk_table_expand_cols (table, right_attach);
-
+ gtk_table_resize (table, table->nrows, right_attach + 1);
+
if (bottom_attach >= table->nrows)
- gtk_table_expand_rows (table, bottom_attach);
-
+ gtk_table_resize (table, bottom_attach + 1, table->ncols);
+
table_child = g_new (GtkTableChild, 1);
table_child->widget = child;
table_child->left_attach = left_attach;
table_child->yshrink = (yoptions & GTK_SHRINK) != 0;
table_child->yfill = (yoptions & GTK_FILL) != 0;
table_child->ypadding = ypadding;
-
+
table->children = g_list_prepend (table->children, table_child);
-
+
gtk_widget_set_parent (child, GTK_WIDGET (table));
-
+
if (GTK_WIDGET_VISIBLE (GTK_WIDGET (table)))
{
if (GTK_WIDGET_REALIZED (GTK_WIDGET (table)) &&
!GTK_WIDGET_MAPPED (child))
gtk_widget_map (child);
}
-
+
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (table))
- gtk_widget_queue_resize (child);
+ gtk_widget_queue_resize (GTK_WIDGET (table));
}
void
gtk_table_attach_defaults (GtkTable *table,
GtkWidget *widget,
- gint left_attach,
- gint right_attach,
- gint top_attach,
- gint bottom_attach)
+ guint left_attach,
+ guint right_attach,
+ guint top_attach,
+ guint bottom_attach)
{
gtk_table_attach (table, widget,
left_attach, right_attach,
void
gtk_table_set_row_spacing (GtkTable *table,
- gint row,
- gint spacing)
+ guint row,
+ guint spacing)
{
g_return_if_fail (table != NULL);
g_return_if_fail (GTK_IS_TABLE (table));
- g_return_if_fail ((row >= 0) && (row < (table->nrows - 1)));
-
+ /* g_return_if_fail ((row >= 0) && (row < (table->nrows - 1))); */
+ g_return_if_fail (row < table->nrows - 1);
+
if (table->rows[row].spacing != spacing)
{
table->rows[row].spacing = spacing;
-
+
if (GTK_WIDGET_VISIBLE (table))
gtk_widget_queue_resize (GTK_WIDGET (table));
}
void
gtk_table_set_col_spacing (GtkTable *table,
- gint column,
- gint spacing)
+ guint column,
+ guint spacing)
{
g_return_if_fail (table != NULL);
g_return_if_fail (GTK_IS_TABLE (table));
- g_return_if_fail ((column >= 0) && (column < (table->ncols - 1)));
-
+ /* g_return_if_fail ((column >= 0) && (column < (table->ncols - 1))); */
+ g_return_if_fail (column < table->ncols - 1);
+
if (table->cols[column].spacing != spacing)
{
table->cols[column].spacing = spacing;
-
+
if (GTK_WIDGET_VISIBLE (table))
gtk_widget_queue_resize (GTK_WIDGET (table));
}
void
gtk_table_set_row_spacings (GtkTable *table,
- gint spacing)
+ guint spacing)
{
- gint row;
-
+ guint row;
+
g_return_if_fail (table != NULL);
g_return_if_fail (GTK_IS_TABLE (table));
-
+
table->row_spacing = spacing;
for (row = 0; row < table->nrows - 1; row++)
table->rows[row].spacing = spacing;
-
+
if (GTK_WIDGET_VISIBLE (table))
gtk_widget_queue_resize (GTK_WIDGET (table));
}
void
gtk_table_set_col_spacings (GtkTable *table,
- gint spacing)
+ guint spacing)
{
- gint col;
-
+ guint col;
+
g_return_if_fail (table != NULL);
g_return_if_fail (GTK_IS_TABLE (table));
-
+
table->column_spacing = spacing;
for (col = 0; col < table->ncols - 1; col++)
table->cols[col].spacing = spacing;
-
+
if (GTK_WIDGET_VISIBLE (table))
gtk_widget_queue_resize (GTK_WIDGET (table));
}
void
gtk_table_set_homogeneous (GtkTable *table,
- gint homogeneous)
+ gboolean homogeneous)
{
g_return_if_fail (table != NULL);
g_return_if_fail (GTK_IS_TABLE (table));
- table->homogeneous = (homogeneous != 0);
-
- if (GTK_WIDGET_VISIBLE (table))
- gtk_widget_queue_resize (GTK_WIDGET (table));
+ homogeneous = (homogeneous != 0);
+ if (homogeneous != table->homogeneous)
+ {
+ table->homogeneous = homogeneous;
+
+ if (GTK_WIDGET_VISIBLE (table))
+ gtk_widget_queue_resize (GTK_WIDGET (table));
+ }
}
-
static void
gtk_table_finalize (GtkObject *object)
{
GtkTable *table;
-
+
g_return_if_fail (object != NULL);
g_return_if_fail (GTK_IS_TABLE (object));
-
+
table = GTK_TABLE (object);
-
+
g_free (table->rows);
g_free (table->cols);
-
+
(* GTK_OBJECT_CLASS (parent_class)->finalize) (object);
}
GtkTable *table;
GtkTableChild *child;
GList *children;
-
+
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TABLE (widget));
-
+
table = GTK_TABLE (widget);
GTK_WIDGET_SET_FLAGS (table, GTK_MAPPED);
-
+
children = table->children;
while (children)
{
child = children->data;
children = children->next;
-
+
if (GTK_WIDGET_VISIBLE (child->widget) &&
- !GTK_WIDGET_MAPPED (child->widget))
- gtk_widget_map (child->widget);
+ !GTK_WIDGET_MAPPED (child->widget))
+ gtk_widget_map (child->widget);
}
}
GtkTable *table;
GtkTableChild *child;
GList *children;
-
+
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TABLE (widget));
-
+
table = GTK_TABLE (widget);
GTK_WIDGET_UNSET_FLAGS (table, GTK_MAPPED);
-
+
children = table->children;
while (children)
{
child = children->data;
children = children->next;
-
+
if (GTK_WIDGET_VISIBLE (child->widget) &&
- GTK_WIDGET_MAPPED (child->widget))
- gtk_widget_unmap (child->widget);
+ GTK_WIDGET_MAPPED (child->widget))
+ gtk_widget_unmap (child->widget);
}
}
GtkTableChild *child;
GList *children;
GdkRectangle child_area;
-
+
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TABLE (widget));
-
+
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
{
table = GTK_TABLE (widget);
-
+
children = table->children;
while (children)
{
child = children->data;
children = children->next;
-
+
if (gtk_widget_intersect (child->widget, area, &child_area))
gtk_widget_draw (child->widget, &child_area);
}
}
static gint
-gtk_table_expose (GtkWidget *widget,
+gtk_table_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkTable *table;
GtkTableChild *child;
GList *children;
GdkEventExpose child_event;
-
+
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_TABLE (widget), FALSE);
-
+
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
{
table = GTK_TABLE (widget);
-
+
child_event = *event;
-
+
children = table->children;
while (children)
{
child = children->data;
children = children->next;
-
+
if (GTK_WIDGET_NO_WINDOW (child->widget) &&
gtk_widget_intersect (child->widget, &event->area, &child_event.area))
gtk_widget_event (child->widget, (GdkEvent*) &child_event);
}
}
-
+
return FALSE;
}
{
GtkTable *table;
gint row, col;
-
+
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TABLE (widget));
g_return_if_fail (requisition != NULL);
-
+
table = GTK_TABLE (widget);
-
+
requisition->width = 0;
requisition->height = 0;
-
+
gtk_table_size_request_init (table);
gtk_table_size_request_pass1 (table);
gtk_table_size_request_pass2 (table);
gtk_table_size_request_pass3 (table);
gtk_table_size_request_pass2 (table);
-
+
for (col = 0; col < table->ncols; col++)
requisition->width += table->cols[col].requisition;
for (col = 0; col < table->ncols - 1; col++)
requisition->width += table->cols[col].spacing;
-
+
for (row = 0; row < table->nrows; row++)
requisition->height += table->rows[row].requisition;
for (row = 0; row < table->nrows - 1; row++)
requisition->height += table->rows[row].spacing;
-
+
requisition->width += GTK_CONTAINER (table)->border_width * 2;
requisition->height += GTK_CONTAINER (table)->border_width * 2;
}
GtkAllocation *allocation)
{
GtkTable *table;
-
+
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TABLE (widget));
g_return_if_fail (allocation != NULL);
-
+
widget->allocation = *allocation;
table = GTK_TABLE (widget);
-
+
gtk_table_size_allocate_init (table);
gtk_table_size_allocate_pass1 (table);
gtk_table_size_allocate_pass2 (table);
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_TABLE (container));
g_return_if_fail (widget != NULL);
-
+
gtk_table_attach_defaults (GTK_TABLE (container), widget, 0, 1, 0, 1);
}
GtkTable *table;
GtkTableChild *child;
GList *children;
-
+
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_TABLE (container));
g_return_if_fail (widget != NULL);
-
+
table = GTK_TABLE (container);
children = table->children;
-
+
while (children)
{
child = children->data;
children = children->next;
-
+
if (child->widget == widget)
- {
+ {
gboolean was_visible = GTK_WIDGET_VISIBLE (widget);
gtk_widget_unparent (widget);
-
- table->children = g_list_remove (table->children, child);
- g_free (child);
-
- if (was_visible && GTK_WIDGET_VISIBLE (container))
- gtk_widget_queue_resize (GTK_WIDGET (container));
- break;
- }
+
+ table->children = g_list_remove (table->children, child);
+ g_free (child);
+
+ if (was_visible && GTK_WIDGET_VISIBLE (container))
+ gtk_widget_queue_resize (GTK_WIDGET (container));
+ break;
+ }
}
}
static void
gtk_table_foreach (GtkContainer *container,
- GtkCallback callback,
- gpointer callback_data)
+ GtkCallback callback,
+ gpointer callback_data)
{
GtkTable *table;
GtkTableChild *child;
GList *children;
-
+
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_TABLE (container));
g_return_if_fail (callback != NULL);
-
+
table = GTK_TABLE (container);
children = table->children;
-
+
while (children)
{
child = children->data;
children = children->next;
-
+
(* callback) (child->widget, callback_data);
}
}
GtkTableChild *child;
GList *children;
gint row, col;
-
+
for (row = 0; row < table->nrows; row++)
table->rows[row].requisition = 0;
for (col = 0; col < table->ncols; col++)
table->cols[col].requisition = 0;
-
+
children = table->children;
while (children)
{
child = children->data;
children = children->next;
-
+
if (GTK_WIDGET_VISIBLE (child->widget))
gtk_widget_size_request (child->widget, &child->widget->requisition);
}
GList *children;
gint width;
gint height;
-
+
children = table->children;
while (children)
{
child = children->data;
children = children->next;
-
+
if (GTK_WIDGET_VISIBLE (child->widget))
- {
- /* Child spans a single column.
- */
- if (child->left_attach == (child->right_attach - 1))
- {
- width = child->widget->requisition.width + child->xpadding * 2;
- table->cols[child->left_attach].requisition = MAX (table->cols[child->left_attach].requisition, width);
- }
-
- /* Child spans a single row.
- */
- if (child->top_attach == (child->bottom_attach - 1))
- {
- height = child->widget->requisition.height + child->ypadding * 2;
- table->rows[child->top_attach].requisition = MAX (table->rows[child->top_attach].requisition, height);
- }
- }
+ {
+ /* Child spans a single column.
+ */
+ if (child->left_attach == (child->right_attach - 1))
+ {
+ width = child->widget->requisition.width + child->xpadding * 2;
+ table->cols[child->left_attach].requisition = MAX (table->cols[child->left_attach].requisition, width);
+ }
+
+ /* Child spans a single row.
+ */
+ if (child->top_attach == (child->bottom_attach - 1))
+ {
+ height = child->widget->requisition.height + child->ypadding * 2;
+ table->rows[child->top_attach].requisition = MAX (table->rows[child->top_attach].requisition, height);
+ }
+ }
}
}
gint max_width;
gint max_height;
gint row, col;
-
+
if (table->homogeneous)
{
max_width = 0;
max_height = 0;
-
+
for (col = 0; col < table->ncols; col++)
- max_width = MAX (max_width, table->cols[col].requisition);
+ max_width = MAX (max_width, table->cols[col].requisition);
for (row = 0; row < table->nrows; row++)
- max_height = MAX (max_height, table->rows[row].requisition);
-
+ max_height = MAX (max_height, table->rows[row].requisition);
+
for (col = 0; col < table->ncols; col++)
- table->cols[col].requisition = max_width;
+ table->cols[col].requisition = max_width;
for (row = 0; row < table->nrows; row++)
- table->rows[row].requisition = max_height;
+ table->rows[row].requisition = max_height;
}
}
gint width, height;
gint row, col;
gint extra;
-
+
children = table->children;
while (children)
{
child = children->data;
children = children->next;
-
+
if (GTK_WIDGET_VISIBLE (child->widget))
- {
- /* Child spans multiple columns.
- */
- if (child->left_attach != (child->right_attach - 1))
- {
- /* Check and see if there is already enough space
- * for the child.
- */
- width = 0;
- for (col = child->left_attach; col < child->right_attach; col++)
- {
- width += table->cols[col].requisition;
- if ((col + 1) < child->right_attach)
- width += table->cols[col].spacing;
- }
-
- /* If we need to request more space for this child to fill
- * its requisition, then divide up the needed space evenly
- * amongst the columns it spans.
- */
- if (width < child->widget->requisition.width + child->xpadding * 2)
- {
- width = child->widget->requisition.width + child->xpadding * 2 - width;
-
- for (col = child->left_attach; col < child->right_attach; col++)
- {
- extra = width / (child->right_attach - col);
+ {
+ /* Child spans multiple columns.
+ */
+ if (child->left_attach != (child->right_attach - 1))
+ {
+ /* Check and see if there is already enough space
+ * for the child.
+ */
+ width = 0;
+ for (col = child->left_attach; col < child->right_attach; col++)
+ {
+ width += table->cols[col].requisition;
+ if ((col + 1) < child->right_attach)
+ width += table->cols[col].spacing;
+ }
+
+ /* If we need to request more space for this child to fill
+ * its requisition, then divide up the needed space evenly
+ * amongst the columns it spans.
+ */
+ if (width < child->widget->requisition.width + child->xpadding * 2)
+ {
+ width = child->widget->requisition.width + child->xpadding * 2 - width;
+
+ for (col = child->left_attach; col < child->right_attach; col++)
+ {
+ extra = width / (child->right_attach - col);
table->cols[col].requisition += extra;
- width -= extra;
- }
- }
- }
-
- /* Child spans multiple rows.
- */
- if (child->top_attach != (child->bottom_attach - 1))
- {
- /* Check and see if there is already enough space
- * for the child.
- */
- height = 0;
- for (row = child->top_attach; row < child->bottom_attach; row++)
- {
- height += table->rows[row].requisition;
- if ((row + 1) < child->bottom_attach)
- height += table->rows[row].spacing;
- }
-
- /* If we need to request more space for this child to fill
- * its requisition, then divide up the needed space evenly
- * amongst the columns it spans.
- */
- if (height < child->widget->requisition.height + child->ypadding * 2)
- {
- height = child->widget->requisition.height + child->ypadding * 2 - height;
-
- for (row = child->top_attach; row < child->bottom_attach; row++)
- {
- extra = height / (child->bottom_attach - row);
+ width -= extra;
+ }
+ }
+ }
+
+ /* Child spans multiple rows.
+ */
+ if (child->top_attach != (child->bottom_attach - 1))
+ {
+ /* Check and see if there is already enough space
+ * for the child.
+ */
+ height = 0;
+ for (row = child->top_attach; row < child->bottom_attach; row++)
+ {
+ height += table->rows[row].requisition;
+ if ((row + 1) < child->bottom_attach)
+ height += table->rows[row].spacing;
+ }
+
+ /* If we need to request more space for this child to fill
+ * its requisition, then divide up the needed space evenly
+ * amongst the columns it spans.
+ */
+ if (height < child->widget->requisition.height + child->ypadding * 2)
+ {
+ height = child->widget->requisition.height + child->ypadding * 2 - height;
+
+ for (row = child->top_attach; row < child->bottom_attach; row++)
+ {
+ extra = height / (child->bottom_attach - row);
table->rows[row].requisition += extra;
- height -= extra;
- }
- }
- }
- }
+ height -= extra;
+ }
+ }
+ }
+ }
}
}
gint row, col;
gint has_expand;
gint has_shrink;
-
+
/* Initialize the rows and cols.
* By default, rows and cols do not expand and do shrink.
* Those values are modified by the children that occupy
table->rows[row].expand = FALSE;
table->rows[row].shrink = TRUE;
}
-
+
/* Loop over all the children and adjust the row and col values
* based on whether the children want to be allowed to expand
* or shrink. This loop handles children that occupy a single
{
child = children->data;
children = children->next;
-
+
if (GTK_WIDGET_VISIBLE (child->widget))
- {
- if (child->left_attach == (child->right_attach - 1))
- {
- if (child->xexpand)
- table->cols[child->left_attach].expand = TRUE;
-
- if (!child->xshrink)
- table->cols[child->left_attach].shrink = FALSE;
- }
-
- if (child->top_attach == (child->bottom_attach - 1))
- {
- if (child->yexpand)
- table->rows[child->top_attach].expand = TRUE;
-
- if (!child->yshrink)
- table->rows[child->top_attach].shrink = FALSE;
- }
- }
+ {
+ if (child->left_attach == (child->right_attach - 1))
+ {
+ if (child->xexpand)
+ table->cols[child->left_attach].expand = TRUE;
+
+ if (!child->xshrink)
+ table->cols[child->left_attach].shrink = FALSE;
+ }
+
+ if (child->top_attach == (child->bottom_attach - 1))
+ {
+ if (child->yexpand)
+ table->rows[child->top_attach].expand = TRUE;
+
+ if (!child->yshrink)
+ table->rows[child->top_attach].shrink = FALSE;
+ }
+ }
}
-
+
/* Loop over all the children again and this time handle children
* which span multiple rows or columns.
*/
{
child = children->data;
children = children->next;
-
+
if (GTK_WIDGET_VISIBLE (child->widget))
- {
- if (child->left_attach != (child->right_attach - 1))
- {
- if (child->xexpand)
- {
- has_expand = FALSE;
- for (col = child->left_attach; col < child->right_attach; col++)
- if (table->cols[col].expand)
- {
- has_expand = TRUE;
- break;
- }
-
- if (!has_expand)
- for (col = child->left_attach; col < child->right_attach; col++)
- table->cols[col].need_expand = TRUE;
- }
-
- if (!child->xshrink)
- {
- has_shrink = TRUE;
- for (col = child->left_attach; col < child->right_attach; col++)
- if (!table->cols[col].shrink)
- {
- has_shrink = FALSE;
- break;
- }
-
- if (has_shrink)
- for (col = child->left_attach; col < child->right_attach; col++)
- table->cols[col].need_shrink = FALSE;
- }
- }
-
- if (child->top_attach != (child->bottom_attach - 1))
- {
- if (child->yexpand)
- {
- has_expand = FALSE;
- for (row = child->top_attach; row < child->bottom_attach; row++)
- if (table->rows[row].expand)
- {
- has_expand = TRUE;
- break;
- }
-
- if (!has_expand)
- for (row = child->top_attach; row < child->bottom_attach; row++)
- table->rows[row].need_expand = TRUE;
- }
-
- if (!child->yshrink)
- {
- has_shrink = TRUE;
- for (row = child->top_attach; row < child->bottom_attach; row++)
- if (!table->rows[row].shrink)
- {
- has_shrink = FALSE;
- break;
- }
-
- if (has_shrink)
- for (row = child->top_attach; row < child->bottom_attach; row++)
- table->rows[row].need_shrink = FALSE;
- }
- }
- }
+ {
+ if (child->left_attach != (child->right_attach - 1))
+ {
+ if (child->xexpand)
+ {
+ has_expand = FALSE;
+ for (col = child->left_attach; col < child->right_attach; col++)
+ if (table->cols[col].expand)
+ {
+ has_expand = TRUE;
+ break;
+ }
+
+ if (!has_expand)
+ for (col = child->left_attach; col < child->right_attach; col++)
+ table->cols[col].need_expand = TRUE;
+ }
+
+ if (!child->xshrink)
+ {
+ has_shrink = TRUE;
+ for (col = child->left_attach; col < child->right_attach; col++)
+ if (!table->cols[col].shrink)
+ {
+ has_shrink = FALSE;
+ break;
+ }
+
+ if (has_shrink)
+ for (col = child->left_attach; col < child->right_attach; col++)
+ table->cols[col].need_shrink = FALSE;
+ }
+ }
+
+ if (child->top_attach != (child->bottom_attach - 1))
+ {
+ if (child->yexpand)
+ {
+ has_expand = FALSE;
+ for (row = child->top_attach; row < child->bottom_attach; row++)
+ if (table->rows[row].expand)
+ {
+ has_expand = TRUE;
+ break;
+ }
+
+ if (!has_expand)
+ for (row = child->top_attach; row < child->bottom_attach; row++)
+ table->rows[row].need_expand = TRUE;
+ }
+
+ if (!child->yshrink)
+ {
+ has_shrink = TRUE;
+ for (row = child->top_attach; row < child->bottom_attach; row++)
+ if (!table->rows[row].shrink)
+ {
+ has_shrink = FALSE;
+ break;
+ }
+
+ if (has_shrink)
+ for (row = child->top_attach; row < child->bottom_attach; row++)
+ table->rows[row].need_shrink = FALSE;
+ }
+ }
+ }
}
-
+
/* Loop over the columns and set the expand and shrink values
* if the column can be expanded or shrunk.
*/
for (col = 0; col < table->ncols; col++)
{
if (table->cols[col].need_expand)
- table->cols[col].expand = TRUE;
+ table->cols[col].expand = TRUE;
if (!table->cols[col].need_shrink)
- table->cols[col].shrink = FALSE;
+ table->cols[col].shrink = FALSE;
}
-
+
/* Loop over the rows and set the expand and shrink values
* if the row can be expanded or shrunk.
*/
for (row = 0; row < table->nrows; row++)
{
if (table->rows[row].need_expand)
- table->rows[row].expand = TRUE;
+ table->rows[row].expand = TRUE;
if (!table->rows[row].need_shrink)
- table->rows[row].shrink = FALSE;
+ table->rows[row].shrink = FALSE;
}
}
gint nexpand;
gint nshrink;
gint extra;
-
+
/* If we were allocated more space than we requested
* then we have to expand any expandable rows and columns
* to fill in the extra space.
*/
-
+
real_width = GTK_WIDGET (table)->allocation.width - GTK_CONTAINER (table)->border_width * 2;
real_height = GTK_WIDGET (table)->allocation.height - GTK_CONTAINER (table)->border_width * 2;
-
+
if (table->homogeneous)
{
nexpand = 0;
for (col = 0; col < table->ncols; col++)
- if (table->cols[col].expand)
- {
- nexpand += 1;
- break;
- }
-
+ if (table->cols[col].expand)
+ {
+ nexpand += 1;
+ break;
+ }
+
if (nexpand > 0)
- {
- width = real_width;
-
- for (col = 0; col < table->ncols - 1; col++)
- width -= table->cols[col].spacing;
-
- for (col = 0; col < table->ncols; col++)
- {
- extra = width / (table->ncols - col);
+ {
+ width = real_width;
+
+ for (col = 0; col < table->ncols - 1; col++)
+ width -= table->cols[col].spacing;
+
+ for (col = 0; col < table->ncols; col++)
+ {
+ extra = width / (table->ncols - col);
table->cols[col].allocation = MAX (1, extra);
- width -= extra;
- }
- }
+ width -= extra;
+ }
+ }
}
else
{
width = 0;
nexpand = 0;
nshrink = 0;
-
+
for (col = 0; col < table->ncols; col++)
- {
- width += table->cols[col].requisition;
- if (table->cols[col].expand)
- nexpand += 1;
- if (table->cols[col].shrink)
- nshrink += 1;
- }
+ {
+ width += table->cols[col].requisition;
+ if (table->cols[col].expand)
+ nexpand += 1;
+ if (table->cols[col].shrink)
+ nshrink += 1;
+ }
for (col = 0; col < table->ncols - 1; col++)
- width += table->cols[col].spacing;
-
+ width += table->cols[col].spacing;
+
/* Check to see if we were allocated more width than we requested.
*/
if ((width < real_width) && (nexpand >= 1))
- {
- width = real_width - width;
-
- for (col = 0; col < table->ncols; col++)
- if (table->cols[col].expand)
- {
- extra = width / nexpand;
+ {
+ width = real_width - width;
+
+ for (col = 0; col < table->ncols; col++)
+ if (table->cols[col].expand)
+ {
+ extra = width / nexpand;
table->cols[col].allocation += extra;
-
- width -= extra;
- nexpand -= 1;
- }
- }
-
+
+ width -= extra;
+ nexpand -= 1;
+ }
+ }
+
/* Check to see if we were allocated less width than we requested.
*/
if ((width > real_width) && (nshrink >= 1))
- {
- width = width - real_width;
-
- for (col = 0; col < table->ncols; col++)
- if (table->cols[col].shrink)
- {
- extra = width / nshrink;
+ {
+ width = width - real_width;
+
+ for (col = 0; col < table->ncols; col++)
+ if (table->cols[col].shrink)
+ {
+ extra = width / nshrink;
table->cols[col].allocation = MAX (1, table->cols[col].allocation - extra);
-
- width -= extra;
- nshrink -= 1;
- }
- }
+
+ width -= extra;
+ nshrink -= 1;
+ }
+ }
}
-
+
if (table->homogeneous)
{
nexpand = 0;
for (row = 0; row < table->nrows; row++)
- if (table->rows[row].expand)
- {
- nexpand += 1;
- break;
- }
-
+ if (table->rows[row].expand)
+ {
+ nexpand += 1;
+ break;
+ }
+
if (nexpand > 0)
- {
- height = real_height;
-
- for (row = 0; row < table->nrows - 1; row++)
- height -= table->rows[row].spacing;
-
-
- for (row = 0; row < table->nrows; row++)
- {
- extra = height / (table->nrows - row);
+ {
+ height = real_height;
+
+ for (row = 0; row < table->nrows - 1; row++)
+ height -= table->rows[row].spacing;
+
+
+ for (row = 0; row < table->nrows; row++)
+ {
+ extra = height / (table->nrows - row);
table->rows[row].allocation = MAX (1, extra);
- height -= extra;
- }
- }
+ height -= extra;
+ }
+ }
}
else
{
height = 0;
nexpand = 0;
nshrink = 0;
-
+
for (row = 0; row < table->nrows; row++)
- {
- height += table->rows[row].requisition;
- if (table->rows[row].expand)
- nexpand += 1;
- if (table->rows[row].shrink)
- nshrink += 1;
- }
+ {
+ height += table->rows[row].requisition;
+ if (table->rows[row].expand)
+ nexpand += 1;
+ if (table->rows[row].shrink)
+ nshrink += 1;
+ }
for (row = 0; row < table->nrows - 1; row++)
- height += table->rows[row].spacing;
-
+ height += table->rows[row].spacing;
+
/* Check to see if we were allocated more height than we requested.
*/
if ((height < real_height) && (nexpand >= 1))
- {
- height = real_height - height;
-
- for (row = 0; row < table->nrows; row++)
- if (table->rows[row].expand)
- {
- extra = height / nexpand;
+ {
+ height = real_height - height;
+
+ for (row = 0; row < table->nrows; row++)
+ if (table->rows[row].expand)
+ {
+ extra = height / nexpand;
table->rows[row].allocation += extra;
-
- height -= extra;
- nexpand -= 1;
- }
- }
-
+
+ height -= extra;
+ nexpand -= 1;
+ }
+ }
+
/* Check to see if we were allocated less height than we requested.
*/
if ((height > real_height) && (nshrink >= 1))
- {
- height = height - real_height;
-
- for (row = 0; row < table->nrows; row++)
- if (table->rows[row].shrink)
- {
- extra = height / nshrink;
+ {
+ height = height - real_height;
+
+ for (row = 0; row < table->nrows; row++)
+ if (table->rows[row].shrink)
+ {
+ extra = height / nshrink;
table->rows[row].allocation = MAX (1, table->rows[row].allocation - extra);
-
- height -= extra;
- nshrink -= 1;
- }
- }
+
+ height -= extra;
+ nshrink -= 1;
+ }
+ }
}
}
gint x, y;
gint row, col;
GtkAllocation allocation;
-
+
children = table->children;
while (children)
{
child = children->data;
children = children->next;
-
+
if (GTK_WIDGET_VISIBLE (child->widget))
- {
- x = GTK_WIDGET (table)->allocation.x + GTK_CONTAINER (table)->border_width;
- y = GTK_WIDGET (table)->allocation.y + GTK_CONTAINER (table)->border_width;
- max_width = 0;
- max_height = 0;
-
- for (col = 0; col < child->left_attach; col++)
- {
- x += table->cols[col].allocation;
- x += table->cols[col].spacing;
- }
-
- for (col = child->left_attach; col < child->right_attach; col++)
- {
- max_width += table->cols[col].allocation;
- if ((col + 1) < child->right_attach)
- max_width += table->cols[col].spacing;
- }
-
- for (row = 0; row < child->top_attach; row++)
- {
- y += table->rows[row].allocation;
- y += table->rows[row].spacing;
- }
-
- for (row = child->top_attach; row < child->bottom_attach; row++)
- {
- max_height += table->rows[row].allocation;
- if ((row + 1) < child->bottom_attach)
- max_height += table->rows[row].spacing;
- }
-
- if (child->xfill)
- {
- allocation.width = MAX (1, max_width - child->xpadding * 2);
- allocation.x = x + (max_width - allocation.width) / 2;
- }
- else
- {
- allocation.width = child->widget->requisition.width;
- allocation.x = x + (max_width - allocation.width) / 2;
- }
-
- if (child->yfill)
- {
- allocation.height = MAX (1, max_height - child->ypadding * 2);
- allocation.y = y + (max_height - allocation.height) / 2;
- }
- else
- {
- allocation.height = child->widget->requisition.height;
- allocation.y = y + (max_height - allocation.height) / 2;
- }
-
+ {
+ x = GTK_WIDGET (table)->allocation.x + GTK_CONTAINER (table)->border_width;
+ y = GTK_WIDGET (table)->allocation.y + GTK_CONTAINER (table)->border_width;
+ max_width = 0;
+ max_height = 0;
+
+ for (col = 0; col < child->left_attach; col++)
+ {
+ x += table->cols[col].allocation;
+ x += table->cols[col].spacing;
+ }
+
+ for (col = child->left_attach; col < child->right_attach; col++)
+ {
+ max_width += table->cols[col].allocation;
+ if ((col + 1) < child->right_attach)
+ max_width += table->cols[col].spacing;
+ }
+
+ for (row = 0; row < child->top_attach; row++)
+ {
+ y += table->rows[row].allocation;
+ y += table->rows[row].spacing;
+ }
+
+ for (row = child->top_attach; row < child->bottom_attach; row++)
+ {
+ max_height += table->rows[row].allocation;
+ if ((row + 1) < child->bottom_attach)
+ max_height += table->rows[row].spacing;
+ }
+
+ if (child->xfill)
+ {
+ allocation.width = MAX (1, max_width - child->xpadding * 2);
+ allocation.x = x + (max_width - allocation.width) / 2;
+ }
+ else
+ {
+ allocation.width = child->widget->requisition.width;
+ allocation.x = x + (max_width - allocation.width) / 2;
+ }
+
+ if (child->yfill)
+ {
+ allocation.height = MAX (1, max_height - child->ypadding * 2);
+ allocation.y = y + (max_height - allocation.height) / 2;
+ }
+ else
+ {
+ allocation.height = child->widget->requisition.height;
+ allocation.y = y + (max_height - allocation.height) / 2;
+ }
+
gtk_widget_size_allocate (child->widget, &allocation);
- }
+ }
}
}
-
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_TABLE(obj) GTK_CHECK_CAST (obj, gtk_table_get_type (), GtkTable)
-#define GTK_TABLE_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_table_get_type (), GtkTableClass)
-#define GTK_IS_TABLE(obj) GTK_CHECK_TYPE (obj, gtk_table_get_type ())
+#define GTK_TYPE_TABLE (gtk_table_get_type ())
+#define GTK_TABLE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TABLE, GtkTable))
+#define GTK_TABLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TABLE, GtkTableClass))
+#define GTK_IS_TABLE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TABLE))
+#define GTK_IS_TABLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TABLE))
-typedef struct _GtkTable GtkTable;
-typedef struct _GtkTableClass GtkTableClass;
-typedef struct _GtkTableChild GtkTableChild;
-typedef struct _GtkTableRowCol GtkTableRowCol;
+typedef struct _GtkTable GtkTable;
+typedef struct _GtkTableClass GtkTableClass;
+typedef struct _GtkTableChild GtkTableChild;
+typedef struct _GtkTableRowCol GtkTableRowCol;
struct _GtkTable
{
GtkContainer container;
-
+
GList *children;
GtkTableRowCol *rows;
GtkTableRowCol *cols;
};
-guint gtk_table_get_type (void);
-GtkWidget* gtk_table_new (gint rows,
- gint columns,
- gint homogeneous);
-
-void gtk_table_attach (GtkTable *table,
- GtkWidget *child,
- gint left_attach,
- gint right_attach,
- gint top_attach,
- gint bottom_attach,
- gint xoptions,
- gint yoptions,
- gint xpadding,
- gint ypadding);
-void gtk_table_attach_defaults (GtkTable *table,
- GtkWidget *widget,
- gint left_attach,
- gint right_attach,
- gint top_attach,
- gint bottom_attach);
-void gtk_table_set_row_spacing (GtkTable *table,
- gint row,
- gint spacing);
-void gtk_table_set_col_spacing (GtkTable *table,
- gint column,
- gint spacing);
-void gtk_table_set_row_spacings (GtkTable *table,
- gint spacing);
-void gtk_table_set_col_spacings (GtkTable *table,
- gint spacing);
-void gtk_table_set_homogeneous (GtkTable *table,
- gint homogeneous);
+GtkType gtk_table_get_type (void);
+GtkWidget* gtk_table_new (guint rows,
+ guint columns,
+ gboolean homogeneous);
+void gtk_table_resize (GtkTable *table,
+ guint rows,
+ guint columns);
+void gtk_table_attach (GtkTable *table,
+ GtkWidget *child,
+ guint left_attach,
+ guint right_attach,
+ guint top_attach,
+ guint bottom_attach,
+ GtkAttachOptions xoptions,
+ GtkAttachOptions yoptions,
+ guint xpadding,
+ guint ypadding);
+void gtk_table_attach_defaults (GtkTable *table,
+ GtkWidget *widget,
+ guint left_attach,
+ guint right_attach,
+ guint top_attach,
+ guint bottom_attach);
+void gtk_table_set_row_spacing (GtkTable *table,
+ guint row,
+ guint spacing);
+void gtk_table_set_col_spacing (GtkTable *table,
+ guint column,
+ guint spacing);
+void gtk_table_set_row_spacings (GtkTable *table,
+ guint spacing);
+void gtk_table_set_col_spacings (GtkTable *table,
+ guint spacing);
+void gtk_table_set_homogeneous (GtkTable *table,
+ gboolean homogeneous);
#ifdef __cplusplus
gtk_tips_query_set_labels (tips_query, tips_query->label_inactive, GTK_VALUE_STRING (*arg));
break;
default:
- arg->type = GTK_TYPE_INVALID;
break;
}
}
static guint toggle_button_signals[LAST_SIGNAL] = { 0 };
-guint
+GtkType
gtk_toggle_button_get_type (void)
{
- static guint toggle_button_type = 0;
+ static GtkType toggle_button_type = 0;
if (!toggle_button_type)
{
#endif /* __cplusplus */
-#define GTK_TOGGLE_BUTTON(obj) GTK_CHECK_CAST (obj, gtk_toggle_button_get_type (), GtkToggleButton)
-#define GTK_TOGGLE_BUTTON_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_toggle_button_get_type (), GtkToggleButtonClass)
-#define GTK_IS_TOGGLE_BUTTON(obj) GTK_CHECK_TYPE (obj, gtk_toggle_button_get_type ())
+#define GTK_TYPE_TOGGLE_BUTTON (gtk_toggle_button_get_type ())
+#define GTK_TOGGLE_BUTTON(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TOGGLE_BUTTON, GtkToggleButton))
+#define GTK_TOGGLE_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOGGLE_BUTTON, GtkToggleButtonClass))
+#define GTK_IS_TOGGLE_BUTTON(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TOGGLE_BUTTON))
+#define GTK_IS_TOGGLE_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOGGLE_BUTTON))
typedef struct _GtkToggleButton GtkToggleButton;
};
-guint gtk_toggle_button_get_type (void);
+GtkType gtk_toggle_button_get_type (void);
GtkWidget* gtk_toggle_button_new (void);
GtkWidget* gtk_toggle_button_new_with_label (const gchar *label);
void gtk_toggle_button_set_mode (GtkToggleButton *toggle_button,
return gtk_type_new (gtk_tooltips_get_type ());
}
-void
+static void
gtk_tooltips_free_string (gpointer data, gpointer user_data)
{
if (data)
GtkSignalFunc func,
gpointer func_data,
GtkArg *args);
+static GtkType gtk_tree_child_type (GtkContainer *container);
static GtkContainerClass *parent_class = NULL;
static guint tree_signals[LAST_SIGNAL] = { 0 };
-guint
+GtkType
gtk_tree_get_type (void)
{
- static guint tree_type = 0;
+ static GtkType tree_type = 0;
if (!tree_type)
{
container_class->remove =
(void (*)(GtkContainer *, GtkWidget *)) gtk_tree_remove_item;
container_class->foreach = gtk_tree_foreach;
+ container_class->child_type = gtk_tree_child_type;
class->selection_changed = NULL;
class->select_child = gtk_real_tree_select_child;
class->unselect_child = gtk_real_tree_unselect_child;
}
+static GtkType
+gtk_tree_child_type (GtkContainer *container)
+{
+ return GTK_TYPE_TREE_ITEM;
+}
+
static void
gtk_tree_init (GtkTree *tree)
{
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_TREE(obj) GTK_CHECK_CAST (obj, gtk_tree_get_type (), GtkTree)
-#define GTK_TREE_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_tree_get_type (), GtkTreeClass)
-#define GTK_IS_TREE(obj) GTK_CHECK_TYPE (obj, gtk_tree_get_type ())
+#define GTK_TYPE_TREE (gtk_tree_get_type ())
+#define GTK_TREE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE, GtkTree))
+#define GTK_TREE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE, GtkTreeClass))
+#define GTK_IS_TREE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE))
+#define GTK_IS_TREE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE))
#define GTK_IS_ROOT_TREE(obj) ((GtkObject*) GTK_TREE(obj)->root_tree == (GtkObject*)obj)
#define GTK_TREE_ROOT_TREE(obj) (GTK_TREE(obj)->root_tree ? GTK_TREE(obj)->root_tree : GTK_TREE(obj))
struct _GtkTree
{
GtkContainer container;
-
+
GList *children;
GtkTree* root_tree; /* owner of selection list */
struct _GtkTreeClass
{
GtkContainerClass parent_class;
-
+
void (* selection_changed) (GtkTree *tree);
void (* select_child) (GtkTree *tree,
GtkWidget *child);
};
-guint gtk_tree_get_type (void);
+GtkType gtk_tree_get_type (void);
GtkWidget* gtk_tree_new (void);
void gtk_tree_append (GtkTree *tree,
GtkWidget *tree_item);
static GtkContainerClass *container_class = NULL;
static guint tree_item_signals[LAST_SIGNAL] = { 0 };
-guint
+GtkType
gtk_tree_item_get_type (void)
{
- static guint tree_item_type = 0;
+ static GtkType tree_item_type = 0;
if (!tree_item_type)
{
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_TREE_ITEM(obj) GTK_CHECK_CAST (obj, gtk_tree_item_get_type (), GtkTreeItem)
-#define GTK_TREE_ITEM_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_tree_item_get_type (), GtkTreeItemClass)
-#define GTK_IS_TREE_ITEM(obj) GTK_CHECK_TYPE (obj, gtk_tree_item_get_type ())
+#define GTK_TYPE_TREE_ITEM (gtk_tree_item_get_type ())
+#define GTK_TREE_ITEM(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE_ITEM, GtkTreeItem))
+#define GTK_TREE_ITEM_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_ITEM, GtkTreeItemClass))
+#define GTK_IS_TREE_ITEM(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE_ITEM))
+#define GTK_IS_TREE_ITEM_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE_ITEM))
+
+#define GTK_TREE_ITEM_SUBTREE(obj) (GTK_TREE_ITEM(obj)->subtree)
-#define GTK_TREE_ITEM_SUBTREE(obj) GTK_TREE_ITEM(obj)->subtree
typedef struct _GtkTreeItem GtkTreeItem;
typedef struct _GtkTreeItemClass GtkTreeItemClass;
};
-guint gtk_tree_item_get_type (void);
+GtkType gtk_tree_item_get_type (void);
GtkWidget* gtk_tree_item_new (void);
GtkWidget* gtk_tree_item_new_with_label (gchar *label);
void gtk_tree_item_set_subtree (GtkTreeItem *tree_item,
{ GTK_ARG_READABLE, "GTK_ARG_READABLE", "readable" },
{ GTK_ARG_WRITABLE, "GTK_ARG_WRITABLE", "writable" },
{ GTK_ARG_CONSTRUCT, "GTK_ARG_CONSTRUCT", "construct" },
+ { GTK_ARG_CHILD_ARG, "GTK_ARG_CHILD_ARG", "child-arg" },
{ GTK_ARG_MASK, "GTK_ARG_MASK", "mask" },
{ GTK_ARG_READWRITE, "GTK_ARG_READWRITE", "readwrite" },
{ 0, NULL, NULL }
};
static GtkEnumValue _gtk_anchor_type_values[] = {
{ GTK_ANCHOR_CENTER, "GTK_ANCHOR_CENTER", "center" },
+ { GTK_ANCHOR_NORTH, "GTK_ANCHOR_NORTH", "north" },
+ { GTK_ANCHOR_NORTH_WEST, "GTK_ANCHOR_NORTH_WEST", "north-west" },
+ { GTK_ANCHOR_NORTH_EAST, "GTK_ANCHOR_NORTH_EAST", "north-east" },
+ { GTK_ANCHOR_SOUTH, "GTK_ANCHOR_SOUTH", "south" },
+ { GTK_ANCHOR_SOUTH_WEST, "GTK_ANCHOR_SOUTH_WEST", "south-west" },
+ { GTK_ANCHOR_SOUTH_EAST, "GTK_ANCHOR_SOUTH_EAST", "south-east" },
+ { GTK_ANCHOR_WEST, "GTK_ANCHOR_WEST", "west" },
+ { GTK_ANCHOR_EAST, "GTK_ANCHOR_EAST", "east" },
{ GTK_ANCHOR_N, "GTK_ANCHOR_N", "n" },
{ GTK_ANCHOR_NW, "GTK_ANCHOR_NW", "nw" },
{ GTK_ANCHOR_NE, "GTK_ANCHOR_NE", "ne" },
dest_arg->d = src_arg->d;
if (src_arg->type == GTK_TYPE_STRING)
- dest_arg->d.pointer_data = g_strdup (src_arg->d.pointer_data);
+ dest_arg->d.string_data = g_strdup (src_arg->d.string_data);
return dest_arg;
}
gulong ulong_data;
gfloat float_data;
gdouble double_data;
+ gchar *string_data;
gpointer pointer_data;
+ GtkObject *object_data;
struct {
GtkCallbackMarshal marshal;
gpointer data;
#define GTK_VALUE_ULONG(a) ((a).d.ulong_data)
#define GTK_VALUE_FLOAT(a) ((a).d.float_data)
#define GTK_VALUE_DOUBLE(a) ((a).d.double_data)
-#define GTK_VALUE_STRING(a) ((a).d.pointer_data)
+#define GTK_VALUE_STRING(a) ((a).d.string_data)
#define GTK_VALUE_ENUM(a) ((a).d.int_data)
#define GTK_VALUE_FLAGS(a) ((a).d.int_data)
#define GTK_VALUE_BOXED(a) ((a).d.pointer_data)
gtk_widget_set_extension_events (widget, GTK_VALUE_FLAGS (*arg));
break;
default:
- arg->type = GTK_TYPE_INVALID;
break;
}
}
gtk_window_position (window, GTK_VALUE_ENUM (*arg));
break;
default:
- arg->type = GTK_TYPE_INVALID;
break;
}
}
}
if ($gen_defs) {
- print ";; generated by makeenums.awk ; -*- scheme -*-\n\n";
+ print ";; generated by makeenums.pl ; -*- scheme -*-\n\n";
} else {
print "/* Generated by makeenums.pl */\n\n";
}